<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Transforms Module Level 2</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="exploring" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="CSS transforms allows elements styled with CSS to be transformed in two-dimensional or three-dimensional space.    This spec add new tranform functions and properties for three-dimensional transforms, and convenience functions for simple transforms." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://drafts.csswg.org/css-transforms-2/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */

.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Transforms Module Level 2</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-transforms-2/">https://drafts.csswg.org/css-transforms-2/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins Jr.</a> (<a class="p-org org" href="http://google.com">Google Inc</a>)
      <dd class="editor p-author h-card vcard" data-editor-id="44066"><a class="p-name fn u-email email" href="mailto:simon.fraser@apple.com">Simon Fraser</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>)
      <dd class="editor p-author h-card vcard" data-editor-id="42080"><a class="p-name fn u-email email" href="mailto:dino@apple.com">Dean Jackson</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>)
      <dd class="editor p-author h-card vcard" data-editor-id="40614"><a class="p-name fn u-email email" href="mailto:eoconnor@apple.com">Theresa O'Connor</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-transforms-2/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-transforms-2">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>CSS transforms allows elements styled with CSS to be transformed in two-dimensional or three-dimensional space.</p>
   <p>This spec add new tranform functions and properties for three-dimensional transforms, and convenience functions for simple transforms.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-transforms” in the title,
	preferably like this:
	“[css-transforms] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
     <ol class="toc">
      <li><a href="#module-interactions"><span class="secno">1.1</span> <span class="content">Module Interactions</span></a>
     </ol>
    <li>
     <a href="#terminology"><span class="secno">2</span> <span class="content">Terminology</span></a>
     <ol class="toc">
      <li><a href="#serialization-of-the-computed-value"><span class="secno">2.1</span> <span class="content">Serialization of the <span>computed value</span> of <span class="production">&lt;transform-list></span></span></a>
     </ol>
    <li><a href="#two-dimensional-subset"><span class="secno">3</span> <span class="content">Two Dimensional Subset</span></a>
    <li>
     <a href="#transform-rendering"><span class="secno">4</span> <span class="content">The Transform Rendering Model</span></a>
     <ol class="toc">
      <li>
       <a href="#3d-transform-rendering"><span class="secno">4.1</span> <span class="content">3D Transform Rendering</span></a>
       <ol class="toc">
        <li><a href="#perspective"><span class="secno">4.1.1</span> <span class="content">Perspective</span></a>
        <li><a href="#3d-rendering-contexts"><span class="secno">4.1.2</span> <span class="content">3D Rendering Contexts</span></a>
        <li><a href="#transformed-element-hierarchies"><span class="secno">4.1.3</span> <span class="content">Transformed element hierarchies</span></a>
        <li><a href="#accumulated-3d-transformation-matrix-computation"><span class="secno">4.1.4</span> <span class="content">Accumulated 3D Transformation Matrix Computation</span></a>
        <li><a href="#backface-visibility"><span class="secno">4.1.5</span> <span class="content">Backface Visibility</span></a>
       </ol>
      <li><a href="#processing-of-perspective-transformed-boxes"><span class="secno">4.2</span> <span class="content">Processing of Perspective-Transformed Boxes</span></a>
     </ol>
    <li>
     <a href="#individual-transforms"><span class="secno">5</span> <span class="content">Individual Transform Properties: the <span class="property">translate</span>, <span class="property">scale</span>, and <span class="property">rotate</span> properties</span></a>
     <ol class="toc">
      <li><a href="#individual-transform-serialization"><span class="secno">5.1</span> <span class="content">Serialization</span></a>
     </ol>
    <li><a href="#ctm"><span class="secno">6</span> <span class="content">Current Transformation Matrix</span></a>
    <li>
     <a href="#transform-style-property"><span class="secno">7</span> <span class="content">The <span class="property">transform-style</span> Property</span></a>
     <ol class="toc">
      <li><a href="#grouping-property-values"><span class="secno">7.1</span> <span class="content">Grouping property values</span></a>
     </ol>
    <li><a href="#perspective-property"><span class="secno">8</span> <span class="content">The <span class="property">perspective</span> Property</span></a>
    <li><a href="#perspective-origin-property"><span class="secno">9</span> <span class="content">The <span class="property">perspective-origin</span> Property</span></a>
    <li><a href="#backface-visibility-property"><span class="secno">10</span> <span class="content">The <span class="property">backface-visibility</span> Property</span></a>
    <li><a href="#svg-three-dimensional-functions"><span class="secno">11</span> <span class="content">SVG and 3D transform functions</span></a>
    <li>
     <a href="#transform-functions"><span class="secno">12</span> <span class="content">The Transform Functions</span></a>
     <ol class="toc">
      <li><a href="#three-d-transform-functions"><span class="secno">12.1</span> <span class="content">3D Transform Functions</span></a>
      <li><a href="#transform-primitives"><span class="secno">12.2</span> <span class="content">Transform function primitives and derivatives</span></a>
     </ol>
    <li>
     <a href="#matrix-interpolation"><span class="secno">13</span> <span class="content">Interpolation of Matrices</span></a>
     <ol class="toc">
      <li>
       <a href="#interpolation-of-3d-matrices"><span class="secno">13.1</span> <span class="content">Interpolation of 3D matrices</span></a>
       <ol class="toc">
        <li><a href="#decomposing-a-3d-matrix"><span class="secno">13.1.1</span> <span class="content">Decomposing a 3D matrix</span></a>
        <li><a href="#interpolation-of-decomposed-3d-matrix-values"><span class="secno">13.1.2</span> <span class="content">Interpolation of decomposed 3D matrix values</span></a>
        <li><a href="#recomposing-to-a-3d-matrix"><span class="secno">13.1.3</span> <span class="content">Recomposing to a 3D matrix</span></a>
       </ol>
     </ol>
    <li><a href="#interpolation-of-transform-functions"><span class="secno">14</span> <span class="content">Interpolation of primitives and derived transform functions</span></a>
    <li>
     <a href="#combining-transform-lists"><span class="secno">15</span> <span class="content">Addition and accumulation of transform lists</span></a>
     <ol class="toc">
      <li><a href="#neutral-element"><span class="secno">15.1</span> <span class="content">Neutral element for addition</span></a>
     </ol>
    <li><a href="#mathematical-description"><span class="secno">16</span> <span class="content">Mathematical Description of Transform Functions</span></a>
    <li><a href="#svg-transform"><span class="secno">17</span> <span class="content">The SVG <span class="property">transform</span> Attribute</span></a>
    <li>
     <a href="#svg-animation"><span class="secno">18</span> <span class="content">SVG Animation</span></a>
     <ol class="toc">
      <li><a href="#svg-animate-element"><span class="secno">18.1</span> <span class="content">The <code><span>animate</span></code> and <code><span>set</span></code> element</span></a>
     </ol>
    <li><a href="#more-issues"><span class="secno">19</span> <span class="content">More Issues</span></a>
    <li><a href="#priv-sec"><span class="secno">20</span> <span class="content">Security and Privacy Considerations</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>This specification is a delta spec that extends <a data-link-type="biblio" href="#biblio-css-transforms-1">[css-transforms-1]</a> to allow authors to transform elements in three-dimensional space.
New transform functions for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform">transform</a> property allow three-dimensional transforms,
and additional properties make working with three-dimensional transforms easier,
and allow the author to control how nested three-dimensional transformed elements interact.</p>
   <ol>
    <li data-md>
     <p>The <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective">perspective</a> property allows the author to provide child elements with an extra perspective transformation. The <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin">perspective-origin</a> property provides control over the origin at which perspective is applied, effectively changing the location of the "vanishing point".</p>
    <li data-md>
     <p>The <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style">transform-style</a> property allows 3D-transformed elements and their 3D-transformed descendants to share a common three-dimensional space, allowing the construction of hierarchies of three-dimensional objects.</p>
    <li data-md>
     <p>The <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility">backface-visibility</a> property comes into play when an element is flipped around via three-dimensional transforms such that its reverse side is visible to the viewer. In some situations it is desirable to hide the element in this situation, which is possible using the value of <span class="css">hidden</span> for this property.</p>
   </ol>
   <p class="note" role="note"><span>Note:</span> While some values of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①">transform</a> property allow an element to be transformed in a three-dimensional coordinate system, the elements themselves are not three-dimensional objects. Instead, they exist on a two-dimensional plane (a flat surface) and have no depth.</p>
   <p>This specification also adds three convenience properties, <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale">scale</a>, <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate">translate</a> and <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate">rotate</a>, that make it easier to describe and animate simple transforms.</p>
   <h3 class="heading settled" data-level="1.1" id="module-interactions"><span class="secno">1.1. </span><span class="content">Module Interactions</span><a class="self-link" href="#module-interactions"></a></h3>
   <p>The <a data-link-type="dfn" href="#3d-transform-functions" id="ref-for-3d-transform-functions">3D transform functions</a> here extend the set of functions for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform②">transform</a> property.</p>
   <p>Some values of <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①">perspective</a>, <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style①">transform-style</a> and <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility①">backface-visibility</a> result in the creation of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants" id="ref-for-containing-block-for-all-descendants">containing block for all descendants</a>, and/or the creation of a <a data-link-type="dfn" href="https://drafts.csswg.org/css2/visuren.html#x43" id="ref-for-x43">stacking context</a>.</p>
   <p>Three-dimensional transforms affect the visual layering of elements, and thus override the back-to-front painting order described in <a href="https://www.w3.org/TR/CSS2/zindex.html">Appendix E</a> of <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.</p>
   <h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2>
   <dl>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="3d-transformed-element">3D transformed element</dfn>
    <dd data-md>
     <p>An element whose computed value for the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform③">transform</a> property includes one of the <a data-link-type="dfn" href="#3d-transform-functions" id="ref-for-3d-transform-functions①">3D transform functions</a></p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="3d-matrix">3D matrix</dfn>
    <dd data-md>
     <p>A 4x4 matrix which does not fulfill the requirements of an <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#2d-matrix" id="ref-for-2d-matrix">2D matrix</a>.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="identity-transform-function">identity transform function</dfn>
    <dd data-md>
     <p>In addition to the identity transform function in CSS Transforms,
examples for identity transform functions include <span class="css">translate3d(0, 0, 0)</span>, <span class="css">translateZ(0)</span>, <span class="css">scaleZ(1)</span>, <span class="css">rotate3d(1, 1, 1, 0)</span>, <span class="css">rotateX(0)</span>, <span class="css">rotateY(0)</span>, <span class="css">rotateZ(0)</span> and <span class="css">matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)</span>.
A special case is perspective: <span class="css">perspective(infinity)</span>.
The value of m<sub>34</sub> becomes infinitesimal small
and the transform function is therefore assumed to be equal to the identity matrix.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="perspective-matrix">perspective matrix</dfn>
    <dd data-md>
     <p>A matrix computed from the values of the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective②">perspective</a> and <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①">perspective-origin</a> properties as described <a href="#perspective-matrix-computation">below</a>.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="accumulated-3d-transformation-matrix">accumulated 3D transformation matrix</dfn>
    <dd data-md>
     <p>A matrix computed for an element relative to the root of its <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context">3D rendering context</a>, as described <a href="#accumulated-3d-transformation-matrix-computation">below</a>.</p>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="3d-rendering-context">3D rendering context</dfn>
    <dd data-md>
     <p>A set of elements with a common ancestor which share a common three-dimensional coordinate system, as described <a href="#3d-rendering-contexts">below</a>.</p>
   </dl>
   <h3 class="heading settled" data-level="2.1" id="serialization-of-the-computed-value"><span class="secno">2.1. </span><span class="content">Serialization of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#computed-value" id="ref-for-computed-value">computed value</a> of <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-transforms-1/#typedef-transform-list" id="ref-for-typedef-transform-list">&lt;transform-list></a></span><a class="self-link" href="#serialization-of-the-computed-value"></a></h3>
   <p>A <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-transforms-1/#typedef-transform-list" id="ref-for-typedef-transform-list①">&lt;transform-list></a> for the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-4/#computed-value" id="ref-for-computed-value①">computed value</a> is serialized to either one <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix">&lt;matrix()></a> or one <a class="production css" data-link-type="function" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d">&lt;matrix3d()></a> function by the following algorithm:</p>
   <ol class="algorithm">
    <li data-md>
     <p>Let <var>transform</var> be a 4x4 matrix initialized to the identity matrix. The elements <var> m11</var>, <var>m22</var>, <var>m33</var> and <var>m44</var> of <var>transform</var> must be set to <span class="css">1</span> all other elements of <var>transform</var> must be set to <span class="css">0</span>.</p>
    <li data-md>
     <p>Post-multiply all <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function">&lt;transform-function></a>s in <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-transforms-1/#typedef-transform-list" id="ref-for-typedef-transform-list②">&lt;transform-list></a> to <var>transform</var>.</p>
    <li data-md>
     <p>Chose between <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix①">&lt;matrix()></a> or <a class="production css" data-link-type="function" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d①">&lt;matrix3d()></a> serialization:</p>
     <dl class="switch">
      <dt>If <var>transform</var> is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#2d-matrix" id="ref-for-2d-matrix①">2D matrix</a> 
      <dd>Serialize <var>transform</var> to a <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix②">&lt;matrix()></a> function. 
      <dt>Otherwise 
      <dd>Serialize <var>transform</var> to a <a class="production css" data-link-type="function" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d②">&lt;matrix3d()></a> function. 
     </dl>
   </ol>
   <p class="issue" id="issue-8241ab72"><a class="self-link" href="#issue-8241ab72"></a> fix this text to add to the text in CSS Transforms 1.</p>
   <h2 class="heading settled" data-level="3" id="two-dimensional-subset"><span class="secno">3. </span><span class="content">Two Dimensional Subset</span><a class="self-link" href="#two-dimensional-subset"></a></h2>
   <p>UAs may not always be able to render three-dimensional transforms and then just support a two-dimensional subset of this specification. In this case <a href="#three-d-transform-functions">three-dimensional transforms</a> and the properties <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style②">transform-style</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective③">perspective</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin②">perspective-origin</a> and <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility②">backface-visibility</a> must not be supported. Section <a href="#3d-transform-rendering">3D Transform Rendering</a> does not apply. Matrix decomposing uses the technique taken from the "unmatrix" method in "Graphics Gems II, edited by Jim Arvo", simplified for the 2D case. Section <a href="#mathematical-description">Mathematical Description of Transform Functions</a> is still effective but can be reduced by using a 3x3 transformation matrix where <em>a</em> equals m<sub>11</sub>, <em>b</em> equals m<sub>12</sub>, <em>c</em> equals m<sub>21</sub>, <em>d</em> equals m<sub>22</sub>, <em>e</em> equals m<sub>41</sub> and <em>f</em> equals m<sub>42</sub> (see A 2D 3x2 matrix with six parameter).</p>
   <div class="figure">
     <img alt="3x3 matrix" height="79" src="images/3x3matrix.png" title="\begin{bmatrix} a &amp; c &amp; e \\ b
	&amp; d &amp; f \\ 0 &amp; 0 &amp; 1 \end{bmatrix}" width="82"> 
    <p class="caption"> 3x3 matrix for two-dimensional transformations. </p>
   </div>
   <div class="example" id="example-d57c1ef5">
    <a class="self-link" href="#example-d57c1ef5"></a> 
    <p>Authors can easily provide a fallback if UAs do not provide support for three-dimensional transforms. The following example has two property definitions for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform④">transform</a>. The first one consists of two two-dimensional transform functions. The second one has a two-dimensional and a three-dimensional transform function.</p>
<pre>div {  transform: scale(2) rotate(45deg);
  transform: scale(2) rotate3d(0, 0, 1, 45deg);
}</pre>
    <p>With 3D support, the second definition will override the first one. Without 3D support, the second definition is invalid and a UA falls back to the first definition.</p>
   </div>
   <h2 class="heading settled" data-level="4" id="transform-rendering"><span class="secno">4. </span><span class="content">The Transform Rendering Model</span><a class="self-link" href="#transform-rendering"></a></h2>
   <p>This specification extends <a href="https://www.w3.org/TR/css-transforms-1/#transform-rendering">CSS Transforms 1 §3 The Transform Rendering Model</a> to account for the existence of three-dimensional transform functions, the Z value of <a class="property" data-link-type="propdesc">transform-orign</a>, the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective④">perspective</a> property, and a new 3D rendering model that applies when the used value of the <span class="css">transform-style</span> property is <span class="css">preserve-3d</span>.</p>
   <p>Three-dimensional transform functions conceptually extend the coordinate space into three dimensions, adding a Z axis perpendicular to the plane of the screen, that increases towards the viewer.</p>
   <div class="figure">
     <img alt="Demonstration of the initial coordinate space" height="240" src="images/coordinates.svg" width="270"> 
    <p class="caption"> Demonstration of the initial coordinate space. </p>
   </div>
   <p id="transformation-matrix-computation"> With 3D transforms, the Z component of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin">transform-origin</a> affects the result, so the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformation-matrix" id="ref-for-transformation-matrix">transformation matrix</a> is computed from the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform⑤">transform</a> and <span class="property" id="ref-for-propdef-transform-origin①">transform-origin</span> properties as follows: </p>
   <ol>
    <li data-md>
     <p>Start with the identity matrix.</p>
    <li data-md>
     <p>Translate by the computed X, Y and Z of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin②">transform-origin</a></p>
    <li data-md>
     <p>Multiply by each of the transform functions in <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform⑥">transform</a> property from left to right</p>
    <li data-md>
     <p>Translate by the negated computed X, Y and Z values of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin③">transform-origin</a></p>
   </ol>
   <h3 class="heading settled" data-level="4.1" id="3d-transform-rendering"><span class="secno">4.1. </span><span class="content">3D Transform Rendering</span><a class="self-link" href="#3d-transform-rendering"></a></h3>
   <p>Normally, elements render as flat planes, and are rendered into the same plane as their stacking context. Often this is the plane shared by the rest of the page. Two-dimensional transform functions can alter the appearance of an element, but that element is still rendered into the same plane as its stacking context.</p>
   <p>An element with a three-dimensional transform that is not contained in a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①">3D rendering context</a> renders with the appropriate transform applied, but does not intersect with any other elements. The three-dimensional transform in this case can be considered just as a painting effect, like two-dimensional transforms. Similarly, the transform does not affect painting order. For example, a transform with a positive Z translation may make an element look larger, but does not cause that element to render in front of elements with no translation in Z.</p>
   <p class="issue" id="issue-aae09890"><a class="self-link" href="#issue-aae09890"></a> describe how nested 3d-transformed elements render (perhaps with math)</p>
   <div class="example" id="example-20b12368">
    <a class="self-link" href="#example-20b12368"></a> 
    <p class="issue" id="issue-699eabea"><a class="self-link" href="#issue-699eabea"></a> This example doesn’t follow from the previous text.</p>
    <p>This example shows the effect of three-dimensional transform applied to an element.</p>
<pre>&lt;style>
div {
    height: 150px;
    width: 150px;
}
.container {
    border: 1px solid black;
}
.transformed {
    transform: rotateY(50deg);
}
&lt;/style>

&lt;div class="container">
    &lt;div class="transformed">&lt;/div>
&lt;/div>
</pre>
    <div class="figure"> <img alt="Div with a rotateY transform." height="190" src="examples/simple-3d-example.png" width="210"> </div>
    <p>The transform is a 50° rotation about the vertical, Y axis. Note how this makes the blue box appear narrower, but not three-dimensional.</p>
   </div>
   <h4 class="heading settled" data-level="4.1.1" id="perspective"><span class="secno">4.1.1. </span><span class="content">Perspective</span><a class="self-link" href="#perspective"></a></h4>
   <p>Perspective can be used to add a feeling of depth to a scene by making elements higher on the Z axis (closer to the viewer) appear larger, and those further away to appear smaller. The scaling is proportional to <var>d</var>/(<var>d</var> − <var>Z</var>) where <var>d</var>, the value of <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective⑤">perspective</a>, is the distance from the drawing plane to the the assumed position of the viewer’s eye.</p>
   <p>The appearance of perspective can be applied to a 3d-transformed element in two ways. First, the element’s 'transform function list' can contain the <a class="css" data-link-type="maybe" href="#funcdef-perspective" id="ref-for-funcdef-perspective">perspective()</a> function which computes into the element’s 'current transformation matrix'.</p>
   <p>Second, the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective⑥">perspective</a> and <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin③">perspective-origin</a> properties can be applied to an element to influence the rendering of its 3d-transformed children, giving them a shared perspective that provides the impression of them living in the same three-dimensional scene.</p>
   <div class="figure">
     <img alt="Diagram of scale vs. Z position" src="images/perspective_distance.png"> 
    <p class="caption"> Diagrams showing how scaling depends on the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective⑦">perspective</a> property and Z position. In the top diagram, <var>Z</var> is half of <var>d</var>. In order to make it appear that the original circle (solid outline) appears at <var>Z</var> (dashed circle), the circle is scaled up by a factor of two, resulting in the light blue circle. In the bottom diagram, the circle is scaled down by a factor of one-third to make it appear behind the original position. </p>
   </div>
   <p>Normally the assumed position of the viewer’s eye is centered on a drawing. This position can be moved if desired – for example, if a web page contains multiple drawings that should share a common perspective – by setting <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin④">perspective-origin</a>.</p>
   <div class="figure">
     <img alt="Diagram of different perspective-origin" src="images/perspective_origin.png"> 
    <p class="caption"> Diagram showing the effect of moving the perspective origin upward. </p>
   </div>
   <p id="perspective-matrix-computation"> The <a data-link-type="dfn" href="#perspective-matrix" id="ref-for-perspective-matrix">perspective matrix</a> is computed as follows: </p>
   <ol>
    <li data-md>
     <p>Start with the identity matrix.</p>
    <li data-md>
     <p>Translate by the computed X and Y values of <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin⑤">perspective-origin</a></p>
    <li data-md>
     <p>Multiply by the matrix that would be obtained from the <a class="css" data-link-type="maybe" href="#funcdef-perspective" id="ref-for-funcdef-perspective①">perspective()</a> transform function, where the length is provided by the value of the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective⑧">perspective</a> property</p>
    <li data-md>
     <p>Translate by the negated computed X and Y values of <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin⑥">perspective-origin</a></p>
   </ol>
   <div class="example" id="example-6ad0c4cd">
    <a class="self-link" href="#example-6ad0c4cd"></a> 
    <p>This example shows how perspective can be used to cause three-dimensional transforms to appear more realistic.</p>
<pre>&lt;style>
div {
  height: 150px;
  width: 150px;
}
.container {
  perspective: 500px;
  border: 1px solid black;
}
.transformed {
  transform: rotateY(50deg);
}
&lt;/style>

&lt;div class="container">
  &lt;div class="transformed">&lt;/div>
&lt;/div>
</pre>
    <div class="figure"> <img alt="Div with a rotateY transform, and perspective on its container" height="190" src="examples/simple-perspective-example.png" width="210"> </div>
    <p>The inner element has the same transform as in the previous example, but its rendering is now influenced by the perspective property on its parent element. Perspective causes vertices that have positive Z coordinates (closer to the viewer) to be scaled up in X and Y, and those further away (negative Z coordinates) to be scaled down, giving an appearance of depth.</p>
   </div>
   <h4 class="heading settled" data-level="4.1.2" id="3d-rendering-contexts"><span class="secno">4.1.2. </span><span class="content">3D Rendering Contexts</span><a class="self-link" href="#3d-rendering-contexts"></a></h4>
   <p>This section specifies the rendering model for content that uses 3D-transforms and the <span class="css">transform-style</span> property. In order to describe this model, we introduce the concept of a "3D rendering context".</p>
   <p>A <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context②">3D rendering context</a> is a set of elements rooted in a common ancestor that, for the purposes of 3D-transform rendering, are considered to share a common three-dimensional coordinate system. The front-to-back rendering of elements in the a 3D rendering context depends on their z-position in that three-dimensional space, and, if the 3D transforms on those elements cause them to intersect, then they are rendered with intersection.</p>
   <p>The position of each element in that three-dimensional space is determined by accumulating the transformation matrices up from the given element to the element that establishes the <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context③">3D rendering context</a>.</p>
   <p>Elements establish and participate in 3D rendering contexts as follows:</p>
   <ul>
    <li data-md>
     <p>A <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context④">3D rendering context</a> is established by a <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element">transformable element</a> whose used value for <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style③">transform-style</a> is <span class="css">preserve-3d</span> and which itself is not part of a 3D rendering context. An element that establishes a 3D rendering context also participates in that context.</p>
    <li data-md>
     <p>An element whose used value for <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style④">transform-style</a> is <span class="css">preserve-3d</span> and which itself participates in a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context⑤">3D rendering context</a>, extends that 3D rendering context rather than establishing a new one.</p>
    <li data-md>
     <p>An element participates in a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context⑥">3D rendering context</a> if its parent establishes or extends a <span id="ref-for-3d-rendering-context⑦">3D rendering context</span>.</p>
   </ul>
   <p>Some CSS properties have values that are considered to force "grouping": they require that their element and its descendants are rendered as a group before being composited with other elements; these include opacity, filters and properties that affect clipping. The relevant property values are listed under <a href="#grouping-property-values">grouping property values</a>. Consequently, when used on an element with transform-style:preserve-3d, they change the used value to <span class="css">flat</span> and prevent it from creating or extending a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context⑧">3D rendering context</a>.</p>
   <p class="issue" id="issue-366ccca6"><a class="self-link" href="#issue-366ccca6"></a> This doesn’t describe how untransformed content within a 3D transformed element is handled, the alogrithm probably needs to be recursive.
Issue: Figure out what the current behaviour of various engines is, and figure out a clearer description that wont break web compat.</p>
   <p>The rendering of elements in a 3D rendering context is as follows (numbers refer to items in <a href="https://www.w3.org/TR/CSS2/zindex.html#painting-order">CSS 2.1, Appendix E, Section E.2 Painting Order</a>):</p>
   <ol style="list-style-type: upper-alpha;">
    <li>The background, borders and other box decorations of the establishing element are rendered (steps 1 and 2) 
    <li>The content and descendant elements without 3D transforms, ordered according to steps 3—7, are rendered into a plane at z=0 relative to to the establishing element. 
    <li>3D-transformed elements are each rendered into their own plane, transformed by the <a href="#accumulated-3d-transformation-matrix-computation">accumulated 3D transformation matrix</a>. 
    <li>Intersection is performed between the set of planes generated by steps B and C, according to <a href="http://en.wikipedia.org/wiki/Newell%27s_algorithm">Newell’s algorithm</a>. 
    <li>The resulting set of planes is rendered on top of the backgrounds and box decorations rendered in this step A. Coplanar <a data-link-type="dfn" href="#3d-transformed-element" id="ref-for-3d-transformed-element">3D transformed elements</a> are rendered in painting order. 
   </ol>
   <p class="issue" id="issue-d667e5bf"><a class="self-link" href="#issue-d667e5bf"></a> is it OK to not pop 2D-transformed elements into their own planes?</p>
   <p class="issue" id="issue-d1f8f85e"><a class="self-link" href="#issue-d1f8f85e"></a> requiring intersection with non-transformed content and descendants requires UAs to allocate additional textures (possibly doubling memory use). Would be more efficient to simply render content and untransformed descendants along with background and borders.</p>
   <p>Note that elements with transforms which have a negative z-component will render behind the content and untransformed descendants of the establishing element, and that <a data-link-type="dfn" href="#3d-transformed-element" id="ref-for-3d-transformed-element①">3D transformed elements</a> may interpenetrate with content and untransformed elements.</p>
   <p class="note" role="note"><span>Note:</span> Because the 3D-transformed elements in a 3D rendering context can all depth-sort and intersect with each other, they are effectively rendered as if they were siblings. The effect of transform-style: preserve-3d can then be thought of as causing all the <a data-link-type="dfn" href="#3d-transformed-element" id="ref-for-3d-transformed-element②">3D transformed elements</a> in a 3D rendering context to be hoisted up into the establishing element, but still rendered with their <a href="#accumulated-3d-transformation-matrix-computation">accumulated 3D transformation matrix</a>.</p>
   <div class="example" id="example-bc92658f">
    <a class="self-link" href="#example-bc92658f"></a> 
<pre>&lt;style>
.scene {
  background-color: rgba(0, 0, 0, 0.3);
  perspective: 500px;
}
.container {
      transform-style: preserve-3d;
}
.container > div {
  position: absolute;
  left: 0;
}
.container > :first-child {
  transform: rotateY(45deg);
  background-color: orange;
  top: 10px;
  height: 135px;
}
.container > :last-child {
  transform: translateZ(40px);
  background-color: rgba(0, 0, 255, 0.6);
  top: 50px;
  height: 100px;
}
&lt;/style>

&lt;div class="scene">
  &lt;div class="container">
    &lt;div>&lt;/div>
    &lt;div>&lt;/div>
  &lt;/div>
&lt;/div>
</pre>
    <p>This example shows show elements in a 3D rendering context can intersect. The container element establishes a 3D rendering context for itself and its two children, and the scene element adds perspective to the 3D rendering context. The children intersect with each other, and the orange element also intersects with the container.</p>
    <div class="figure"> <img alt="Intersecting sibling elements." height="198" src="examples/3d-intersection.png" width="210"> </div>
   </div>
   <div class="example" id="example-11326f44">
    <a class="self-link" href="#example-11326f44"></a> 
<pre>&lt;style>
div {
  height: 150px;
  width: 150px;
}
.container {
  perspective: 500px;
  border: 1px solid black;
}
.transformed {
  transform: rotateY(50deg);
  background-color: blue;
}
.child {
  transform-origin: top left;
  transform: rotateX(40deg);
  background-color: lime;
}
&lt;/style>

&lt;div class="container">
  &lt;div class="transformed">
    &lt;div class="child">&lt;/div>
  &lt;/div>
&lt;/div>
</pre>
    <p>This example shows how nested 3D transforms are rendered. The blue div is transformed as in the previous example, with its rendering influenced by the perspective on its parent element. The lime element also has a 3D transform, which is a rotation about the X axis (anchored at the top, by virtue of the transform-origin). However, the lime element is being rendered into the plane of its parent because it is not a member of the same 3D rendering context; the parent is <a data-link-type="dfn">flattening</a>. Thus the lime element only appears shorter; it does not "pop out" of the blue element.</p>
    <div class="figure"> <img alt="Nested 3D transforms, with flattening" height="200" src="examples/3d-rendering-context-flat.png" width="240"> </div>
   </div>
   <h4 class="heading settled" data-level="4.1.3" id="transformed-element-hierarchies"><span class="secno">4.1.3. </span><span class="content">Transformed element hierarchies</span><a class="self-link" href="#transformed-element-hierarchies"></a></h4>
   <p>By default, <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformed-element" id="ref-for-transformed-element">transformed elements</a> do not create a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context⑨">3D rendering context</a> and create a flattened representation of their content. However, since it is useful to construct hierarchies of transformed objects that share a common 3-dimensional space, this flattening behavior may be overridden by specifying a value of <span class="css">preserve-3d</span> for the <span class="css">transform-style</span> property. This allows descendants of the transformed element to share the same 3D rendering context. Non-3D-transformed descendants of such elements are rendered into the plane of the element in step C above, but 3D-transformed elements in the same 3D rendering context will "pop out" into their own planes.</p>
   <div class="example" id="example-1069e278">
    <a class="self-link" href="#example-1069e278"></a> 
<pre>&lt;style>
div {
  height: 150px;
  width: 150px;
}
.container {
  perspective: 500px;
  border: 1px solid black;
}
.transformed {
  <b>transform-style: preserve-3d</b>;
  transform: rotateY(50deg);
  background-color: blue;
}
.child {
  transform-origin: top left;
  transform: rotateX(40deg);
  background-color: lime;
}
&lt;/style>
</pre>
    <p>This example is identical to the previous example, with the addition of <a class="css" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style⑤">transform-style: preserve-3d</a> on the blue element. The blue element now extends the 3D rendering context of its container. Now both blue and lime elements share a common three-dimensional space, so the lime element renders as tilting out from its parent, influenced by the perspective on the container.</p>
    <div class="figure"> <img alt="Nested 3D transforms, with preserve-3d." height="200" src="examples/3d-rendering-context-3d.png" width="240"> </div>
   </div>
   <h4 class="heading settled" data-level="4.1.4" id="accumulated-3d-transformation-matrix-computation"><span class="secno">4.1.4. </span><span class="content">Accumulated 3D Transformation Matrix Computation</span><a class="self-link" href="#accumulated-3d-transformation-matrix-computation"></a></h4>
   <p>The final value of the transform used to render an element in a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①⓪">3D rendering context</a> is computed by accumulating an <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix">accumulated 3D transformation matrix</a> as follows:</p>
   <ol>
    <li data-md>
     <p>Let <var>transform</var> be the identity matrix.</p>
    <li data-md>
     <p>Let <var>current element</var> be the transformed element.</p>
    <li data-md>
     <p>Let <var>parent element</var> be the parent element of the transformed element.</p>
    <li data-md>
     <p>While <var>current element</var> is not the element that establishes the transformed element’s <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①①">3D rendering context</a>:</p>
     <ol>
      <li data-md>
       <p>If <var>current element</var> has a value for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform⑦">transform</a> which is not <span class="css">none</span>, pre-multiply <var>current element</var>’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformation-matrix" id="ref-for-transformation-matrix①">transformation matrix</a> with the <var>transform</var>.</p>
      <li data-md>
       <p>Compute a translation matrix which represents the offset of <var>current element</var> from its <var>parent element</var>, and pre-multiply that matrix into the <var>transform</var>.</p>
      <li data-md>
       <p>If <var>parent element</var> has a value for <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective⑨">perspective</a> which is not <a class="css" data-link-type="maybe" href="#valdef-perspective-none" id="ref-for-valdef-perspective-none">none</a>, pre-multiply the <var>parent element</var>’s <a data-link-type="dfn" href="#perspective-matrix" id="ref-for-perspective-matrix①">perspective matrix</a> into the <var>transform</var>.</p>
      <li data-md>
       <p>Let <var>current element</var> be the <var>parent element</var>.</p>
      <li data-md>
       <p>Let <var>parent element</var> be the <var>current element</var>’s parent.</p>
     </ol>
   </ol>
   <p class="note" role="note"><span>Note:</span> as described here, the <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix①">accumulated 3D transformation matrix</a> takes into account offsets generated by the <a href="https://www.w3.org/TR/REC-CSS2/visuren.html">visual formatting model</a> on the transformed element, and elements in the ancestor chain between the transformed element and the element that establishes the its <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①②">3D rendering context</a>.</p>
   <h4 class="heading settled" data-level="4.1.5" id="backface-visibility"><span class="secno">4.1.5. </span><span class="content">Backface Visibility</span><a class="self-link" href="#backface-visibility"></a></h4>
   <p>Using three-dimensional transforms, it’s possible to transform an element such that its reverse side is visible. 3D-transformed elements show the same content on both sides, so the reverse side looks like a mirror-image of the front side (as if the element were projected onto a sheet of glass). Normally, elements whose reverse side is towards the viewer remain visible. However, the <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility③">backface-visibility</a> property allows the author to make an element invisible when its reverse side is towards the viewer. This behavior is "live"; if an element with <span class="css" id="ref-for-propdef-backface-visibility④">backface-visibility: hidden</span> were animating, such that its front and reverse sides were alternately visible, then it would only be visible when the front side were towards the viewer.</p>
   <p>Visibility of the reverse side of an element is considered using the <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix②">accumulated 3D transformation matrix</a>, and is thus relative to the parent of the element that establishes the <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①③">3D rendering context</a>.</p>
   <p class="note" role="note"><span>Note:</span> This property is useful when you place two elements back-to-back, as you would to create a playing card. Without this property, the front and back elements could switch places at times during an animation to flip the card. Another example is creating a box out of 6 elements, but where you want to see only the inside faces of the box.</p>
   <div class="example" id="example-551edcaa">
    <a class="self-link" href="#example-551edcaa"></a> 
    <p>This example shows how to make a "card" element that flips over when clicked. Note the "transform-style: preserve-3d" on #card which is necessary to avoid flattening when flipped.</p>
<pre>&lt;style>
.body { perspective: 500px; }
#card {
  position: relative;
  height: 300px; width: 200px;
  transition: transform 1s;
  transform-style: preserve-3d;
}
#card.flipped {
  transform: rotateY(180deg);
}
.face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: silver;
  border-radius: 40px;
  backface-visibility: hidden;
}
.back {
  transform: rotateY(180deg);
}
&lt;/style>
&lt;div id="card" onclick="this.classList.toggle('flipped')">
  &lt;div class="front face">Front&lt;/div>
  &lt;div class="back face">Back&lt;/div>
&lt;/div>
</pre>
   </div>
   <p class="issue" id="issue-7b36039d"><a class="self-link" href="#issue-7b36039d"></a> what is the impact of backface-visibility on non-transformed or 2D-transformed elements? Do they get popped into their own planes and intersect?</p>
   <h3 class="heading settled" data-level="4.2" id="processing-of-perspective-transformed-boxes"><span class="secno">4.2. </span><span class="content">Processing of Perspective-Transformed Boxes</span><a class="self-link" href="#processing-of-perspective-transformed-boxes"></a></h3>
   <p class="issue" id="issue-0f626662"><a class="self-link" href="#issue-0f626662"></a> This is a first pass at an attempt to precisely specify how exactly to transform elements using the provided matrices. It might not be ideal, and implementer feedback is encouraged.  See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15605">bug 15605</a>.</p>
   <p>The <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix③">accumulated 3D transformation matrix</a> is affected both by the <span class="css">perspective</span> property, and by any perspective() transform function present in the value of the <span class="css">transform</span> property.</p>
   <p>This <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix④">accumulated 3D transformation matrix</a> is a 4×4 matrix, while the objects to be transformed are two-dimensional boxes. To transform each corner (<var>a</var>, <var>b</var>) of a box, the matrix must first be applied to (<var>a</var>, <var>b</var>, 0, 1), which will result in a four-dimensional point (<var>x</var>, <var>y</var>, <var>z</var>, <var>w</var>).  This is transformed back to a three-dimensional point (<var>x</var>′, <var>y</var>′, <var>z</var>′) as follows:</p>
   <p>If <var>w</var> > 0, (<var>x</var>′, <var>y</var>′, <var>z</var>′) = (<var>x</var>/<var>w</var>, <var>y</var>/<var>w</var>, <var>z</var>/<var>w</var>).</p>
   <p>If <var>w</var> = 0, (<var>x</var>′, <var>y</var>′, <var>z</var>′) = (<var>x</var> ⋅ <var>n</var>, <var>y</var> ⋅ <var>n</var>, <var>z</var> ⋅ <var>n</var>). <var>n</var> is an implementation-dependent value that should be chosen so that <var>x</var>′ or <var>y</var>′ is much larger than the viewport size, if possible.  For example, (5px, 22px, 0px, 0) might become (5000px, 22000px, 0px), with <var>n</var> = 1000, but this value of <var>n</var> would be too small for (0.1px, 0.05px, 0px, 0). This specification does not define the value of <var>n</var> exactly.  Conceptually, (<var>x</var>′, <var>y</var>′, <var>z</var>′) is <a href="http://en.wikipedia.org/wiki/Plane_at_infinity">infinitely far</a> in the direction (<var>x</var>, <var>y</var>, <var>z</var>).</p>
   <p>If <var>w</var> &lt; 0 for all four corners of the transformed box, the box is not rendered.</p>
   <p>If <var>w</var> &lt; 0 for one to three corners of the transformed box, the box must be replaced by a polygon that has any parts with <var>w</var> &lt; 0 cut out. This will in general be a polygon with three to five vertices, of which exactly two will have <var>w</var> = 0 and the rest <var>w</var> > 0. These vertices are then transformed to three-dimensional points using the rules just stated.  Conceptually, a point with <var>w</var> &lt; 0 is "behind" the viewer, so should not be visible.</p>
   <div class="example" id="example-b7386d44">
    <a class="self-link" href="#example-b7386d44"></a> 
<pre>.transformed {
  height: 100px;
  width: 100px;
  background: lime;
  transform: perspective(50px) translateZ(100px);
}
</pre>
    <p>All of the box’s corners have <var>z</var>-coordinates greater than the perspective.  This means that the box is behind the viewer and will not display.  Mathematically, the point (<var>x</var>, <var>y</var>) first becomes (<var>x</var>, <var>y</var>, 0, 1), then is translated to (<var>x</var>, <var>y</var>, 100, 1), and then applying the perspective results in (<var>x</var>, <var>y</var>, 100, −1). The <var>w</var>-coordinate is negative, so it does not display. An implementation that doesn’t handle the <var>w</var> &lt; 0 case separately might incorrectly display this point as (−<var>x</var>, −<var>y</var>, −100), dividing by −1 and mirroring the box.</p>
   </div>
   <div class="example" id="example-81d81b28">
    <a class="self-link" href="#example-81d81b28"></a> 
<pre>.transformed {
  height: 100px;
  width: 100px;
  background: radial-gradient(yellow, blue);
  transform: perspective(50px) translateZ(50px);
}
</pre>
    <p>Here, the box is translated upward so that it sits at the same place the viewer is looking from. This is like bringing the box closer and closer to one’s eye until it fills the entire field of vision. Since the default transform-origin is at the center of the box, which is yellow, the screen will be filled with yellow.</p>
    <p>Mathematically, the point (<var>x</var>, <var>y</var>) first becomes (<var>x</var>, <var>y</var>, 0, 1), then is translated to (<var>x</var>, <var>y</var>, 50, 1), then becomes (<var>x</var>, <var>y</var>, 50, 0) after applying perspective. Relative to the transform-origin at the center, the upper-left corner was (−50, −50), so it becomes (−50,
		−50, 50, 0).  This is transformed to something very far to the upper left, such as (−5000, −5000, 5000).  Likewise the other corners are sent very far away. The radial gradient is stretched over the whole box, now enormous, so the part that’s visible without scrolling should be the color of the middle pixel: yellow.  However, since the box is not actually infinite, the user can still scroll to the edges to see the blue parts.</p>
   </div>
   <div class="example" id="example-834b4b29">
    <a class="self-link" href="#example-834b4b29"></a> 
<pre>.transformed {
  height: 50px;
  width: 50px;
  background: lime;
  border: 25px solid blue;
  transform-origin: left;
  transform: perspective(50px) rotateY(-45deg);
}
</pre>
    <p>The box will be rotated toward the viewer, with the left edge staying fixed while the right edge swings closer.  The right edge will be at about <var>z</var> = <span class="css">70.7px</span>, which is closer than the perspective of <span class="css">50px</span>. Therefore, the rightmost edge will vanish ("behind" the viewer), and the visible part will stretch out infinitely far to the right.</p>
    <p>Mathematically, the top right vertex of the box was originally (100, −50), relative to the transform-origin. It is first expanded to (100, −50, 0, 1).  After applying the transform specified, this will get mapped to about (70.71, −50, 70.71, −0.4142). This has <var>w</var> = −0.4142 &lt; 0, so we need to slice away the part of the box with <var>w</var> &lt; 0.  This results in the new top-right vertex being (50, −50, 50, 0).  This is then mapped to some faraway point in the same direction, such as (5000, −5000, 5000), which is up and to the right from the transform-origin.  Something similar is done to the lower right corner, which gets mapped far down and to the right. The resulting box stretches far past the edge of the screen.</p>
    <p>Again, the rendered box is still finite, so the user can scroll to see the whole thing if he or she chooses. However, the right part has been chopped off.  No matter how far the user scrolls, the rightmost <span class="css">30px</span> or so of the original box will not be visible.  The blue border was only <span class="css">25px</span> wide, so it will be visible on the left, top, and bottom, but not the right.</p>
    <p>The same basic procedure would apply if one or three vertices had <var>w</var> &lt; 0.  However, in that case the result of truncating the <var>w</var> &lt; 0 part would be a triangle or pentagon instead of a quadrilateral.</p>
   </div>
   <h2 class="heading settled" data-level="5" id="individual-transforms"><span class="secno">5. </span><span class="content">Individual Transform Properties: the <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate①">translate</a>, <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale①">scale</a>, and <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate①">rotate</a> properties</span><a class="self-link" href="#individual-transforms"></a></h2>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate②">translate</a>, <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate②">rotate</a>, and <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale②">scale</a> properties
allow authors to specify simple transforms independently,
in a way that maps to typical user interface usage,
rather than having to remember the order in <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform⑧">transform</a> that keeps the actions of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translate" id="ref-for-funcdef-transform-translate">translate()</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate">rotate()</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scale" id="ref-for-funcdef-transform-scale">scale()</a> independent and acting in screen coordinates.</p>
   <table class="def propdef" data-link-for-hint="translate">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-translate">translate</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage">&lt;length-percentage></a> [ <span class="production" id="ref-for-typedef-length-percentage①">&lt;length-percentage></span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a> ]<span id="ref-for-mult-opt①">?</span>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element①">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>relative to the width of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box">reference box</a> (for the first value) or the height (for the second value)
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none">none</a> or a pair of computed <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②">&lt;length-percentage></a> values and optionally an absolute length
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value, adding a third <span class="css">0</span> value if needed to match components, but see below for <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none①">none</a>
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate③">translate</a> property accepts 1-3 values,
each specifying a translation against one axis,
in the order X, Y, then Z.</p>
   <p>If only one or two values are given,
this specifies a 2d translation,
equivalent to the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translate" id="ref-for-funcdef-transform-translate①">translate()</a> function.
If the second value is missing,
it defaults to <span class="css">0px</span>.</p>
   <p>If three values are given,
this specifies a 3d translation,
equivalent to the <a class="css" data-link-type="maybe" href="#funcdef-translate3d" id="ref-for-funcdef-translate3d">translate3d()</a> function.</p>
   <table class="def propdef" data-link-for-hint="rotate">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-rotate">rotate</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value" title="Expands to: turn | rad | grad | deg">&lt;angle></a> <span id="ref-for-comb-one②">|</span> [ x <span id="ref-for-comb-one③">|</span> y <span id="ref-for-comb-one④">|</span> z <span id="ref-for-comb-one⑤">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value">&lt;number></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-num" id="ref-for-mult-num">{3}</a> ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-all" id="ref-for-comb-all">&amp;&amp;</a> <span class="production" id="ref-for-angle-value①" title="Expands to: turn | rad | grad | deg">&lt;angle></span>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element②">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none②">none</a>, or an <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value②" title="Expands to: turn | rad | grad | deg">&lt;angle></a> with an optional axis consisting of a list of three <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value①">&lt;number></a>s
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>as SLERP, but see below for <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none③">none</a>
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate③">rotate</a> property accepts an angle to rotate an element,
and optionally an axis to rotate it around.</p>
   <p>If the axis is omitted, this specifies a 2d rotation,
equivalent to the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate①">rotate()</a> function.</p>
   <p>Otherwise, it specifies a 3d rotation:
if <dfn class="css" data-dfn-for="rotate" data-dfn-type="value" data-export id="valdef-rotate-x">x<a class="self-link" href="#valdef-rotate-x"></a></dfn>, <dfn class="css" data-dfn-for="rotate" data-dfn-type="value" data-export id="valdef-rotate-y">y<a class="self-link" href="#valdef-rotate-y"></a></dfn>,
or <dfn class="css" data-dfn-for="rotate" data-dfn-type="value" data-export id="valdef-rotate-z">z<a class="self-link" href="#valdef-rotate-z"></a></dfn> is given,
it specifies a rotation around that axis,
equivalent to the <a class="css" data-link-type="maybe" href="#funcdef-rotatex" id="ref-for-funcdef-rotatex">rotateX()</a>/etc 3d transform functions.
Alternately, the axis can be specified explicitly
by giving three numbers
representing the x, y, and z components of an origin-centered vector,
equivalent to the <a class="css" data-link-type="maybe" href="#funcdef-rotate3d" id="ref-for-funcdef-rotate3d">rotate3d()</a> function.</p>
   <p class="note" role="note"><span>Note:</span> While <a class="css" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate④">rotate: 30deg;</a> and <span class="css" id="ref-for-propdef-rotate⑤">rotate: z 30deg;</span> technically specify the same rotation,
the first declaration is a 2d transform equivalent to <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform⑨">transform: rotate(30deg);</a>,
while the second is a 3d transform equivalent to <span class="css" id="ref-for-propdef-transform①⓪">transform: rotateZ(30deg);</span>,
which can have additional side-effects in UAs.</p>
   <table class="def propdef" data-link-for-hint="scale">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-scale">scale</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑥">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value②">&lt;number></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-num-range" id="ref-for-mult-num-range">{1,3}</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element③">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none④">none</a>, or a list of 2 or 3 <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value③">&lt;number></a>s
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value, but see below for <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none⑤">none</a>
   </table>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale③">scale</a> property accepts 1-3 values,
each specifying a scale along one axis,
in order X, Y, then Z.</p>
   <p>If only the X value is given,
the Y value defaults to the same value.</p>
   <p>If one or two values are given,
this specifies a 2d scaling,
equivalent to the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scale" id="ref-for-funcdef-transform-scale①">scale()</a> function.
If three values are given,
this specifies a 3d scaling,
equivalent to the <a class="css" data-link-type="maybe" href="#funcdef-scale3d" id="ref-for-funcdef-scale3d">scale3d()</a> function.</p>
   <hr>
   <p>All three properties accept
(and default to)
the value <dfn class="dfn-paneled css" data-dfn-for="translate, rotate, scale" data-dfn-type="value" data-export id="valdef-translate-none">none</dfn>,
which produces no transform at all.
In particular,
this value does <em>not</em> trigger the creation of a stacking context or <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants" id="ref-for-containing-block-for-all-descendants①">containing block for all descendants</a>,
while all other values
(including “identity” transforms like <a class="css" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate④">translate: 0px</a>)
create a stacking context and <span id="ref-for-containing-block-for-all-descendants②">containing block for all descendants</span>,
per usual for transforms.</p>
   <p>When <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate⑤">translate</a>, <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate⑥">rotate</a> or <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale④">scale</a> are animating or transitioning, and the from value or to
value (but not both) is <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none⑥">none</a>, the value <span class="css" id="ref-for-valdef-translate-none⑦">none</span> is replaced by the equivalent identity
value (<span class="css">0px</span> for translate, <span class="css">0deg</span> for rotate, <span class="css">1</span> for scale).</p>
   <h3 class="heading settled" data-level="5.1" id="individual-transform-serialization"><span class="secno">5.1. </span><span class="content">Serialization</span><a class="self-link" href="#individual-transform-serialization"></a></h3>
   <p>Because these properties have three distinct modes of behavior
(no transform, 2d transform, or 3d transform),
serialization must take this into account:</p>
   <dl>
    <dt data-md>for <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate⑥">translate</a>
    <dd data-md>
     <p>If a 2d translation is specified,
the property must serialize with only one or two values
(per usual, if the second value is <span class="css">0px</span>, the default,
it must be omitted when serializing).</p>
     <p>If a 3d translation is specified,
all three values must be serialized.</p>
     <p>It must serialize as the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none⑧">none</a> if and only if <span class="css" id="ref-for-valdef-translate-none⑨">none</span> was originally specified.
(An identity transform does not count;
it must serialize as the 2d or 3d version,
as appropriate.)</p>
    <dt data-md>for <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate⑦">rotate</a>
    <dd data-md>
     <p>If a 2d rotation is specified,
the property must serialize as just an <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value③" title="Expands to: turn | rad | grad | deg">&lt;angle></a>.</p>
     <p>If a 3d rotation is specified,
the property must serialize with an axis specified.
If the axis is parallel with the x, y, or z axises,
it must serialize as the appropriate keyword.</p>
     <p>It must serialize as the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none①⓪">none</a> if and only if <span class="css" id="ref-for-valdef-translate-none①①">none</span> was originally specified.
(An identity transform does not count;
it must serialize as the 2d or 3d version,
as appropriate.)</p>
    <dt data-md>for <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale⑤">scale</a>
    <dd data-md>
     <p>If a 2d scale is specified,
the property must serialize with only one or two values
(per usual, if the second value is the same as the first, the default,
it must be omitted when serializing).</p>
     <p>If a 3d scale is specified,
all three values must be serialized.</p>
     <p>It must serialize as the keyword <a class="css" data-link-type="maybe" href="#valdef-translate-none" id="ref-for-valdef-translate-none①②">none</a> if and only if <span class="css" id="ref-for-valdef-translate-none①③">none</span> was originally specified.
(An identity transform does not count;
it must serialize as the 2d or 3d version,
as appropriate.)</p>
   </dl>
   <h2 class="heading settled" data-level="6" id="ctm"><span class="secno">6. </span><span class="content">Current Transformation Matrix</span><a class="self-link" href="#ctm"></a></h2>
   <p>The <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformation-matrix" id="ref-for-transformation-matrix②">transformation matrix</a> computation is amended to the following:</p>
   <p>The transformation matrix is computed from the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①①">transform</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin④">transform-origin</a>, <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate⑦">translate</a>, <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate⑧">rotate</a>, <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale⑥">scale</a>, and <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/motion-1/#propdef-offset" id="ref-for-propdef-offset">offset</a> properties as follows:</p>
   <ol>
    <li data-md>
     <p>Start with the identity matrix.</p>
    <li data-md>
     <p>Translate by the computed X, Y, and Z values of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin⑤">transform-origin</a>.</p>
    <li data-md>
     <p>Translate by the computed X, Y, and Z values of <a class="property" data-link-type="propdesc" href="#propdef-translate" id="ref-for-propdef-translate⑧">translate</a>.</p>
    <li data-md>
     <p>Rotate by the computed <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value④" title="Expands to: turn | rad | grad | deg">&lt;angle></a> about the specified axis of <a class="property" data-link-type="propdesc" href="#propdef-rotate" id="ref-for-propdef-rotate⑨">rotate</a>.</p>
    <li data-md>
     <p>Scale by the computed X, Y, and Z values of <a class="property" data-link-type="propdesc" href="#propdef-scale" id="ref-for-propdef-scale⑦">scale</a>.</p>
    <li data-md>
     <p>Translate and rotate by the transform specified by <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/motion-1/#propdef-offset" id="ref-for-propdef-offset①">offset</a>.</p>
    <li data-md>
     <p>Multiply by each of the transform functions in <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①②">transform</a> from left to right.</p>
    <li data-md>
     <p>Translate by the negated computed X, Y and Z values of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin⑥">transform-origin</a>.</p>
   </ol>
   <h2 class="heading settled" data-level="7" id="transform-style-property"><span class="secno">7. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style⑥">transform-style</a> Property</span><a class="self-link" href="#transform-style-property"></a></h2>
   <table class="def propdef" data-link-for-hint="transform-style">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-transform-style">transform-style</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">flat <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑦">|</a> preserve-3d
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>flat
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element④">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>N/A
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>discrete
     <tr>
      <th>Used value:
      <td>flat if a <a href="#grouping-property-values">grouping property</a> is present, specified keyword otherwise
   </table>
   <p>A computed value of <span class="css">preserve-3d</span> for <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style⑦">transform-style</a> establishes both a stacking context and a <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants" id="ref-for-containing-block-for-all-descendants③">containing block for all descendants</a>. If the used value is <span class="css">preserve-3d</span> then it also establishes or extends a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①④">3D rendering context</a>.</p>
   <h3 class="heading settled" data-level="7.1" id="grouping-property-values"><span class="secno">7.1. </span><span class="content">Grouping property values</span><a class="self-link" href="#grouping-property-values"></a></h3>
   <p>The following CSS property values require the user agent to create a flattened representation of the descendant elements before they can be applied, and therefore force the element to have a used style of <span class="css">flat</span> for <a class="property" data-link-type="propdesc">preserve-3d</a>.</p>
   <ul>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a>: any value other than <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible" id="ref-for-valdef-overflow-visible">visible</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip" id="ref-for-valdef-overflow-clip">clip</a>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-4/#propdef-opacity" id="ref-for-propdef-opacity">opacity</a>: any value less than 1.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/filter-effects-1/#propdef-filter" id="ref-for-propdef-filter">filter</a>: any value other than <span class="css">none</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/css-masking-1/#propdef-clip" id="ref-for-propdef-clip">clip</a>: any value other than <span class="css">auto</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/css-masking-1/#propdef-clip-path" id="ref-for-propdef-clip-path">clip-path</a>: any value other than <span class="css">none</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/compositing-2/#propdef-isolation" id="ref-for-propdef-isolation">isolation</a>: used value of <span class="css">isolate</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/css-masking-1/#propdef-mask-image" id="ref-for-propdef-mask-image">mask-image</a>: any value other than <span class="css">none</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/css-masking-1/#propdef-mask-border-source" id="ref-for-propdef-mask-border-source">mask-border-source</a>: any value other than <span class="css">none</span>.</p>
    <li data-md>
     <p><a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/compositing-2/#propdef-mix-blend-mode" id="ref-for-propdef-mix-blend-mode">mix-blend-mode</a>: any value other than <span class="css">normal</span>.</p>
   </ul>
   <h2 class="heading settled" data-level="8" id="perspective-property"><span class="secno">8. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①⓪">perspective</a> Property</span><a class="self-link" href="#perspective-property"></a></h2>
   <table class="def propdef" data-link-for-hint="perspective">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-perspective">perspective</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑧">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value①" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length [0,∞]></a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element⑤">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>N/A
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-perspective-none" id="ref-for-valdef-perspective-none①">none</a> or an absolute length
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value
   </table>
   <dl>
    <dt data-md><dfn class="css" data-dfn-for="perspective" data-dfn-type="value" data-export id="valdef-perspective-length-0"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value②" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length [0,∞]></a><a class="self-link" href="#valdef-perspective-length-0"></a></dfn>
    <dd data-md>
     <p>Distance to the center of projection.</p>
     <p class="issue" id="issue-8678c096"><a class="self-link" href="#issue-8678c096"></a> Verify that projection is the distance to the center of projection.</p>
     <p>As very small <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value③" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> values can produce bizarre rendering results
and stress the numerical accuracy of transform calculations,
values less than <span class="css">1px</span> must be treated as <span class="css">1px</span> for rendering purposes.
(This clamping does not affect the underlying value,
so <a class="css" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①①">perspective: 0;</a> in a stylesheet
will still serialize back as <span class="css">0</span>.)</p>
    <dt data-md><dfn class="dfn-paneled css" data-dfn-for="perspective" data-dfn-type="value" data-export id="valdef-perspective-none">none</dfn>
    <dd data-md>
     <p>No perspective transform is applied. The effect is mathematically similar to an infinite <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value④" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> value. All objects appear to be flat on the canvas.</p>
   </dl>
   <p>The use of this property with any value other than <a class="css" data-link-type="maybe" href="#valdef-perspective-none" id="ref-for-valdef-perspective-none②">none</a> establishes a stacking context. It also establishes a <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants" id="ref-for-containing-block-for-all-descendants④">containing block for all descendants</a>, just like the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①③">transform</a> property does.</p>
   <p class="issue" id="issue-d6818476"><a class="self-link" href="#issue-d6818476"></a> We don’t really need to be a stacking context or containing block for perspective, but maybe webcompat means we can’t change this.</p>
   <p>The values of the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①②">perspective</a> and <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin⑦">perspective-origin</a> properties are used to compute the <a data-link-type="dfn" href="#perspective-matrix" id="ref-for-perspective-matrix②">perspective matrix</a>, as described above.</p>
   <h2 class="heading settled" data-level="9" id="perspective-origin-property"><span class="secno">9. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin⑧">perspective-origin</a> Property</span><a class="self-link" href="#perspective-origin-property"></a></h2>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin⑨">perspective-origin</a> property establishes the origin for the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①③">perspective</a> property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element.</p>
   <table class="def propdef" data-link-for-hint="perspective-origin">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-perspective-origin">perspective-origin</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position">&lt;position></a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>50% 50%
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element⑥">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>refer to the size of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box①">reference box</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>see <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position" id="ref-for-propdef-background-position">background-position</a>
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value
   </table>
   <p>The values of the <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①④">perspective</a> and <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①⓪">perspective-origin</a> properties are used to compute the <a data-link-type="dfn" href="#perspective-matrix" id="ref-for-perspective-matrix③">perspective matrix</a>, as described above.</p>
   <p>The values for <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①①">perspective-origin</a> represent an offset of the perspective origin from the top left corner of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box②">reference box</a>.</p>
   <dl>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-percentage"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value" id="ref-for-percentage-value">&lt;percentage></a><a class="self-link" href="#valdef-perspective-origin-percentage"></a></dfn>
    <dd data-md>
     <p>A percentage for the horizontal perspective offset is relative to the width of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box③">reference box</a>. A percentage for the vertical offset is relative to height of the <span id="ref-for-reference-box④">reference box</span>. The value for the horizontal and vertical offset represent an offset from the top left corner of the <span id="ref-for-reference-box⑤">reference box</span>.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-length"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value⑤" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a><a class="self-link" href="#valdef-perspective-origin-length"></a></dfn>
    <dd data-md>
     <p>A length value gives a fixed length as the offset. The value for the horizontal and vertical offset represent an offset from the top left corner of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box⑥">reference box</a>.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-top">top<a class="self-link" href="#valdef-perspective-origin-top"></a></dfn>
    <dd data-md>
     <p>Computes to <span class="css">0%</span> for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-right">right<a class="self-link" href="#valdef-perspective-origin-right"></a></dfn>
    <dd data-md>
     <p>Computes to <span class="css">100%</span> for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-bottom">bottom<a class="self-link" href="#valdef-perspective-origin-bottom"></a></dfn>
    <dd data-md>
     <p>Computes to <span class="css">100%</span> for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-left">left<a class="self-link" href="#valdef-perspective-origin-left"></a></dfn>
    <dd data-md>
     <p>Computes to <span class="css">0%</span> for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.</p>
    <dt data-md><dfn class="css" data-dfn-for="perspective-origin" data-dfn-type="value" data-export id="valdef-perspective-origin-center">center<a class="self-link" href="#valdef-perspective-origin-center"></a></dfn>
    <dd data-md>
     <p>Computes to <span class="css">50%</span> (<span class="css">left 50%</span>) for the horizontal position if the horizontal position is not otherwise specified, or <span class="css">50%</span> (<span class="css">top 50%</span>) for the vertical position if it is.</p>
   </dl>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①②">perspective-origin</a> property is a <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property-like-height" id="ref-for-resolved-value-special-case-property-like-height">resolved value special case property like <span class="css">height</span></a>. <a data-link-type="biblio" href="#biblio-cssom">[CSSOM]</a></p>
   <h2 class="heading settled" data-level="10" id="backface-visibility-property"><span class="secno">10. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility⑤">backface-visibility</a> Property</span><a class="self-link" href="#backface-visibility-property"></a></h2>
   <table class="def propdef" data-link-for-hint="backface-visibility">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-backface-visibility">backface-visibility</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">visible <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑨">|</a> hidden
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>visible
     <tr>
      <th>Applies to:
      <td><a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#transformable-element" id="ref-for-transformable-element⑦">transformable elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>N/A
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>discrete
   </table>
   <p>The visibility of an element with <a class="css" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility⑥">backface-visibility: hidden</a> is determined as follows:</p>
   <ol>
    <li data-md>
     <p>Compute the element’s <a data-link-type="dfn" href="#accumulated-3d-transformation-matrix" id="ref-for-accumulated-3d-transformation-matrix⑤">accumulated 3D transformation matrix</a>.</p>
    <li data-md>
     <p>If the component of the matrix in row 3, column 3 is negative, then the element should be hidden. Otherwise it is visible.</p>
   </ol>
   <p class="issue" id="issue-972d97c8"><a class="self-link" href="#issue-972d97c8"></a> Backface-visibility cannot be tested by only looking at m33. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=23014">Bug 23014</a>.</p>
   <p class="note" role="note"><span>Note:</span> The reasoning for this definition is as follows. Assume elements are rectangles in the <var>x</var>–<var>y</var> plane with infinitesimal thickness. The front of the untransformed element has coordinates like (<var>x</var>, <var>y</var>, <var>ε</var>), and the back is (<var>x</var>, <var>y</var>, −<var>ε</var>), for some very small <var>ε</var>. We want to know if after the transformation, the front of the element is closer to the viewer than the back (higher <var>z</var>-value) or further away. The <var>z</var>-coordinate of the front will be m<sub>13</sub><var>x</var> + m<sub>23</sub><var>y</var> + m<sub>33</sub><var>ε</var> + m<sub>43</sub>, before accounting for perspective, and the back will be m<sub>13</sub><var>x</var> + m<sub>23</sub><var>y</var> − m<sub>33</sub><var>ε</var> + m<sub>43</sub>.  The first quantity is greater than the second if and only if m<sub>33</sub> > 0. (If it equals zero, the front and back are equally close to the viewer. This probably means something like a 90-degree rotation, which makes the element invisible anyway, so we don’t really care whether it vanishes.)</p>
   <h2 class="heading settled" data-level="11" id="svg-three-dimensional-functions"><span class="secno">11. </span><span class="content">SVG and 3D transform functions</span><a class="self-link" href="#svg-three-dimensional-functions"></a></h2>
   <p>This specification explicitly requires three-dimensional transform functions to apply to the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/struct.html#container-element" id="ref-for-container-element">container elements</a>: <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" id="ref-for-the-a-element">a</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/struct.html#elementdef-g" id="ref-for-elementdef-g">g</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/struct.html#elementdef-svg" id="ref-for-elementdef-svg">svg</a></code>, all <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/struct.html#graphics-element" id="ref-for-graphics-element">graphics elements</a>, all <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/struct.html#graphics-referencing-element" id="ref-for-graphics-referencing-element">graphics referencing elements</a> and the SVG <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/embedded.html#elementdef-foreignObject" id="ref-for-elementdef-foreignObject">foreignObject</a></code> element.</p>
   <p>Three-dimensional transform functions and the properties <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①⑤">perspective</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①③">perspective-origin</a>, <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style⑧">transform-style</a> and <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility⑦">backface-visibility</a> can not be used for the elements: <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath">clipPath</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient" id="ref-for-elementdef-linearGradient">linearGradient</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient" id="ref-for-elementdef-radialGradient">radialGradient</a></code> and <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern">pattern</a></code>. If a transform list includes a three-dimensional transform function, the complete transform list must be ignored. The values of every previously named property must be ignored. Transformable elements that are contained by one of these elements can have three-dimensional transform functions. The <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath①">clipPath</a></code>, <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-mask" id="ref-for-elementdef-mask">mask</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern①">pattern</a></code> elements require the user agent to create a flattened representation of the descendant elements before they can be applied, and therefore override the behavior of <span class="css" id="ref-for-propdef-transform-style⑨">transform-style: preserve-3d</span>.</p>
   <p>If the <a class="property" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/coords.html#VectorEffectProperty" id="ref-for-VectorEffectProperty">vector-effect</a> property is set to <span class="css">non-scaling-stroke</span> and an object is within a <a data-link-type="dfn" href="#3d-rendering-context" id="ref-for-3d-rendering-context①⑤">3D rendering context</a> the property has no affect on stroking the object.</p>
   <h2 class="heading settled" data-level="12" id="transform-functions"><span class="secno">12. </span><span class="content">The Transform Functions</span><a class="self-link" href="#transform-functions"></a></h2>
   <p>The value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①④">transform</a> property is a list of <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-transform-function">&lt;transform-function></dfn>. The set of allowed transform functions is given below. Wherever <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value⑤" title="Expands to: turn | rad | grad | deg">&lt;angle></a> is used in this specification, a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value④">&lt;number></a> that is equal to zero is also allowed, which is treated the same as an angle of zero degrees. A percentage for horizontal translations is relative to the width of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-transforms-1/#reference-box" id="ref-for-reference-box⑦">reference box</a>. A percentage for vertical translations is relative to the height of the <span id="ref-for-reference-box⑧">reference box</span>.</p>
   <h3 class="heading settled" data-level="12.1" id="three-d-transform-functions"><span class="secno">12.1. </span><span class="content">3D Transform Functions</span><a class="self-link" href="#three-d-transform-functions"></a></h3>
   <p>In the following <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="3d-transform-functions">3d transform functions</dfn>, a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value">&lt;zero></a> behaves the same as <span class="css">0deg</span>.
("Unitless 0" angles are preserved for legacy compat reasons.)</p>
   <dl>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-matrix3d">matrix3d()</dfn> = matrix3d( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value⑤">&lt;number></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-comma" id="ref-for-mult-comma">#{16}</a> )</span>
    <dd data-md>
     <p>specifies a 3D transformation as a 4x4 homogeneous matrix of 16 values in column-major order.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-translate3d">translate3d()</dfn> = translate3d( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage③">&lt;length-percentage></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma">,</a> <span class="production" id="ref-for-typedef-length-percentage④">&lt;length-percentage></span> <span id="ref-for-comb-comma①">,</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value⑥" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> )</span>
    <dd data-md>
     <p>specifies a <a href="#Translate3dDefined">3D translation</a> by the vector [tx,ty,tz], with tx, ty and tz being the first, second and third translation-value parameters respectively.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-translatez">translateZ()</dfn> = translateZ( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value⑦" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length></a> )</span>
    <dd data-md>
     <p>specifies a <a href="#Translate3dDefined">3D translation</a> by the vector [0,0,tz] with the given amount in the Z direction.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-scale3d">scale3d()</dfn> = scale3d( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value⑥">&lt;number></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma②">,</a> <span class="production" id="ref-for-number-value⑦">&lt;number></span><span id="ref-for-comb-comma③">,</span> <span class="production" id="ref-for-number-value⑧">&lt;number></span> )</span>
    <dd data-md>
     <p>specifies a <a href="#Scale3dDefined">3D scale</a> operation by the [sx,sy,sz] scaling vector described by the 3 parameters.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-scalez">scaleZ()</dfn> = scaleZ( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value⑨">&lt;number></a> )</span>
    <dd data-md>
     <p>specifies a <a href="#Scale3dDefined">3D scale</a> operation using the [1,1,sz] scaling vector, where sz is given as the parameter.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-rotate3d">rotate3d()</dfn> = rotate3d( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value①⓪">&lt;number></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma④">,</a> <span class="production" id="ref-for-number-value①①">&lt;number></span> <span id="ref-for-comb-comma⑤">,</span> <span class="production" id="ref-for-number-value①②">&lt;number></span> <span id="ref-for-comb-comma⑥">,</span> [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value⑥" title="Expands to: turn | rad | grad | deg">&lt;angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⓪">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value①">&lt;zero></a> ] )</span>
    <dd data-md>
     <p>specifies a <a href="#Rotate3dDefined">3D rotation</a> by the angle specified in last parameter about the [x,y,z] direction vector described by the first three parameters. A direction vector that cannot be normalized, such as [0,0,0], will cause the rotation to not be applied.</p>
     <p class="note" role="note"><span>Note:</span> the rotation is clockwise as one looks from the end of the vector toward the origin.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-rotatex">rotateX()</dfn> = rotateX( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value⑦" title="Expands to: turn | rad | grad | deg">&lt;angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①①">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value②">&lt;zero></a> ] )</span>
    <dd data-md>
     <p>same as <span class="css">rotate3d(1, 0, 0, &lt;angle>)</span>.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-rotatey">rotateY()</dfn> = rotateY( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value⑧" title="Expands to: turn | rad | grad | deg">&lt;angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①②">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value③">&lt;zero></a> ] )</span>
    <dd data-md>
     <p>same as <span class="css">rotate3d(0, 1, 0, &lt;angle>)</span>.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-rotatez">rotateZ()</dfn> = rotateZ( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" id="ref-for-angle-value⑨" title="Expands to: turn | rad | grad | deg">&lt;angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①③">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value④">&lt;zero></a> ] )</span>
    <dd data-md>
     <p>same as <span class="css">rotate3d(0, 0, 1, &lt;angle>)</span>, which is a 3d transform equivalent to the 2d transform <span class="css">rotate(&lt;angle>)</span>.</p>
    <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-perspective">perspective()</dfn> = perspective( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" id="ref-for-length-value⑧" title="Expands to: em | vb | ch | cm | vh | vi | in | ex | vw | ic | pt | px | lh | pc | rem | rlh | vmax | advance measure | vmin | mm | cap | q">&lt;length [0,∞]></a> )</span>
    <dd data-md>
     <p>specifies a <a href="#PerspectiveDefined">perspective projection matrix</a>. This matrix scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged. The parameter represents the distance of the z=0 plane from the viewer. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect. For example, a value of 1000px gives a moderate amount of foreshortening and a value of 200px gives an extreme amount.</p>
     <p>If the depth value is less than <span class="css">1px</span>,
it must be treated as <span class="css">1px</span> for the purpose of rendering.</p>
   </dl>
   <h3 class="heading settled" data-level="12.2" id="transform-primitives"><span class="secno">12.2. </span><span class="content">Transform function primitives and derivatives</span><a class="self-link" href="#transform-primitives"></a></h3>
   <p>Some transform functions can be represented by more generic transform functions. These transform functions are called derived transform functions, and the generic transform functions are called primitive transform functions. Three-dimensional primitives and their derived transform functions are:</p>
   <dl>
    <dt id="translate3d-primitive"><a class="self-link" href="#translate3d-primitive"></a><a class="css" data-link-type="maybe" href="#funcdef-translate3d" id="ref-for-funcdef-translate3d①">translate3d()</a> 
    <dd>for <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex" id="ref-for-funcdef-transform-translatex">&lt;translateX()></a>, <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatey" id="ref-for-funcdef-transform-translatey">&lt;translateY()></a>, <a class="css" data-link-type="maybe" href="#funcdef-translatez" id="ref-for-funcdef-translatez">translateZ()</a> and <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translate" id="ref-for-funcdef-transform-translate②">&lt;translate()></a>. 
    <dt id="scale3d-primitive"><a class="self-link" href="#scale3d-primitive"></a><a class="css" data-link-type="maybe" href="#funcdef-scale3d" id="ref-for-funcdef-scale3d①">scale3d()</a> 
    <dd>for <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scalex" id="ref-for-funcdef-transform-scalex">&lt;scaleX()></a>, <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scaley" id="ref-for-funcdef-transform-scaley">&lt;scaleY()></a>, <a class="css" data-link-type="maybe" href="#funcdef-scalez" id="ref-for-funcdef-scalez">scaleZ()</a> and <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scale" id="ref-for-funcdef-transform-scale②">&lt;scale()></a>. 
    <dt id="rotate3d-primitive"><a class="self-link" href="#rotate3d-primitive"></a><a class="css" data-link-type="maybe" href="#funcdef-rotate3d" id="ref-for-funcdef-rotate3d①">rotate3d()</a> 
    <dd>for <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate②">&lt;rotate()></a>, <a class="css" data-link-type="maybe" href="#funcdef-rotatex" id="ref-for-funcdef-rotatex①">rotateX()</a>, <a class="css" data-link-type="maybe" href="#funcdef-rotatey" id="ref-for-funcdef-rotatey">rotateY()</a> and <a class="css" data-link-type="maybe" href="#funcdef-rotatez" id="ref-for-funcdef-rotatez">rotateZ()</a>. 
   </dl>
   <p id="interpolation-two-three-dimensional-function"> For derived transform functions that have a two-dimensional primitive and a three-dimensional primitive, the context decides about the used primitive. See <a href="#interpolation-of-transform-functions">Interpolation of primitives and derived transform functions</a>. </p>
   <h2 class="heading settled" data-level="13" id="matrix-interpolation"><span class="secno">13. </span><span class="content">Interpolation of Matrices</span><a class="self-link" href="#matrix-interpolation"></a></h2>
   <p>When interpolating between two matrices, each matrix is decomposed into the corresponding translation, rotation, scale, skew and (for a <a data-link-type="dfn" href="#3d-matrix" id="ref-for-3d-matrix">3D matrix</a>) perspective values. Each corresponding component of the decomposed matrices gets interpolated numerically and recomposed back to a matrix in a final step.</p>
   <h3 class="heading settled" data-level="13.1" id="interpolation-of-3d-matrices"><span class="secno">13.1. </span><span class="content">Interpolation of 3D matrices</span><a class="self-link" href="#interpolation-of-3d-matrices"></a></h3>
   <h4 class="heading settled" data-level="13.1.1" id="decomposing-a-3d-matrix"><span class="secno">13.1.1. </span><span class="content">Decomposing a 3D matrix</span><a class="self-link" href="#decomposing-a-3d-matrix"></a></h4>
   <p>The pseudo code below is based upon the "unmatrix" method in "Graphics Gems II, edited by Jim Arvo", but modified to use Quaternions instead of Euler angles to avoid the problem of Gimbal Locks.</p>
   <p>The following pseudocode works on a 4x4 homogeneous matrix:</p>
<pre>Input:  matrix      ; a 4x4 matrix
Output: translation ; a 3 component vector
        scale       ; a 3 component vector
        skew        ; skew factors XY,XZ,YZ represented as a 3 component vector
        perspective ; a 4 component vector
        quaternion  ; a 4 component vector
Returns false if the matrix cannot be decomposed, true if it can


// Normalize the matrix.
if (matrix[3][3] == 0)
    return false

for (i = 0; i &lt; 4; i++)
    for (j = 0; j &lt; 4; j++)
        matrix[i][j] /= matrix[3][3]

// perspectiveMatrix is used to solve for perspective, but it also provides
// an easy way to test for singularity of the upper 3x3 component.
perspectiveMatrix = matrix

for (i = 0; i &lt; 3; i++)
    perspectiveMatrix[i][3] = 0

perspectiveMatrix[3][3] = 1

if (determinant(perspectiveMatrix) == 0)
    return false

// First, isolate perspective.
if (matrix[0][3] != 0 || matrix[1][3] != 0 || matrix[2][3] != 0)
    // rightHandSide is the right hand side of the equation.
    rightHandSide[0] = matrix[0][3]
    rightHandSide[1] = matrix[1][3]
    rightHandSide[2] = matrix[2][3]
    rightHandSide[3] = matrix[3][3]

    // Solve the equation by inverting perspectiveMatrix and multiplying
    // rightHandSide by the inverse.
    inversePerspectiveMatrix = inverse(perspectiveMatrix)
    transposedInversePerspectiveMatrix = transposeMatrix4(inversePerspectiveMatrix)
    perspective = multVecMatrix(rightHandSide, transposedInversePerspectiveMatrix)
else
    // No perspective.
    perspective[0] = perspective[1] = perspective[2] = 0
    perspective[3] = 1

// Next take care of translation
for (i = 0; i &lt; 3; i++)
    translate[i] = matrix[3][i]

// Now get scale and shear. 'row' is a 3 element array of 3 component vectors
for (i = 0; i &lt; 3; i++)
    row[i][0] = matrix[i][0]
    row[i][1] = matrix[i][1]
    row[i][2] = matrix[i][2]

// Compute X scale factor and normalize first row.
scale[0] = length(row[0])
row[0] = normalize(row[0])

// Compute XY shear factor and make 2nd row orthogonal to 1st.
skew[0] = dot(row[0], row[1])
row[1] = combine(row[1], row[0], 1.0, -skew[0])

// Now, compute Y scale and normalize 2nd row.
scale[1] = length(row[1])
row[1] = normalize(row[1])
skew[0] /= scale[1];

// Compute XZ and YZ shears, orthogonalize 3rd row
skew[1] = dot(row[0], row[2])
row[2] = combine(row[2], row[0], 1.0, -skew[1])
skew[2] = dot(row[1], row[2])
row[2] = combine(row[2], row[1], 1.0, -skew[2])

// Next, get Z scale and normalize 3rd row.
scale[2] = length(row[2])
row[2] = normalize(row[2])
skew[1] /= scale[2]
skew[2] /= scale[2]

// At this point, the matrix (in rows) is orthonormal.
// Check for a coordinate system flip.  If the determinant
// is -1, then negate the matrix and the scaling factors.
pdum3 = cross(row[1], row[2])
if (dot(row[0], pdum3) &lt; 0)
    for (i = 0; i &lt; 3; i++)
        scale[i] *= -1;
        row[i][0] *= -1
        row[i][1] *= -1
        row[i][2] *= -1

// Now, get the rotations out
quaternion[0] = 0.5 * sqrt(max(1 + row[0][0] - row[1][1] - row[2][2], 0))
quaternion[1] = 0.5 * sqrt(max(1 - row[0][0] + row[1][1] - row[2][2], 0))
quaternion[2] = 0.5 * sqrt(max(1 - row[0][0] - row[1][1] + row[2][2], 0))
quaternion[3] = 0.5 * sqrt(max(1 + row[0][0] + row[1][1] + row[2][2], 0))

if (row[2][1] > row[1][2])
    quaternion[0] = -quaternion[0]
if (row[0][2] > row[2][0])
    quaternion[1] = -quaternion[1]
if (row[1][0] > row[0][1])
    quaternion[2] = -quaternion[2]

return true</pre>
   <h4 class="heading settled" data-level="13.1.2" id="interpolation-of-decomposed-3d-matrix-values"><span class="secno">13.1.2. </span><span class="content">Interpolation of decomposed 3D matrix values</span><a class="self-link" href="#interpolation-of-decomposed-3d-matrix-values"></a></h4>
   <p>Each component of the decomposed values translation, scale, skew and perspective of the source matrix get linearly interpolated with each corresponding component of the destination matrix.</p>
   <p class="note" role="note"><span>Note:</span> For instance, <code>translate[0]</code> of the source matrix and <code>translate[0]</code> of the destination matrix are interpolated numerically, and the result is used to set the translation of the animating element.</p>
   <p>Quaternions of the decomposed source matrix are interpolated with quaternions of the decomposed destination matrix using the spherical linear interpolation (Slerp) as described by the pseudo code below:</p>
<pre>Input:  quaternionA   ; a 4 component vector
        quaternionB   ; a 4 component vector
        t             ; interpolation parameter with 0 &lt;= t &lt;= 1
Output: quaternionDst ; a 4 component vector


product = dot(quaternionA, quaternionB)

// Clamp product to -1.0 &lt;= product &lt;= 1.0
product = min(product, 1.0)
product = max(product, -1.0)

if (abs(product) == 1.0)
   quaternionDst = quaternionA
   return

theta = acos(dot)
w = sin(t * theta) * 1 / sqrt(1 - product * product)

for (i = 0; i &lt; 4; i++)
  quaternionA[i] *= cos(t * theta) - product * w
  quaternionB[i] *= w
  quaternionDst[i] = quaternionA[i] + quaternionB[i]

return</pre>
   <h4 class="heading settled" data-level="13.1.3" id="recomposing-to-a-3d-matrix"><span class="secno">13.1.3. </span><span class="content">Recomposing to a 3D matrix</span><a class="self-link" href="#recomposing-to-a-3d-matrix"></a></h4>
   <p>After interpolation, the resulting values are used to transform the elements user space. One way to use these values is to recompose them into a 4x4 matrix. This can be done following the pseudo code below:</p>
<pre>Input:  translation ; a 3 component vector
        scale       ; a 3 component vector
        skew        ; skew factors XY,XZ,YZ represented as a 3 component vector
        perspective ; a 4 component vector
        quaternion  ; a 4 component vector
Output: matrix      ; a 4x4 matrix

Supporting functions (matrix is a 4x4 matrix):
  matrix  multiply(matrix a, matrix b)   returns the 4x4 matrix product of a * b

// apply perspective
for (i = 0; i &lt; 4; i++)
  matrix[i][3] = perspective[i]

// apply translation
for (i = 0; i &lt; 4; i++)
  for (j = 0; j &lt; 3; j++)
    matrix[3][i] += translation[j] * matrix[j][i]

// apply rotation
x = quaternion[0]
y = quaternion[1]
z = quaternion[2]
w = quaternion[3]

// Construct a composite rotation matrix from the quaternion values
// rotationMatrix is a identity 4x4 matrix initially
rotationMatrix[0][0] = 1 - 2 * (y * y + z * z)
rotationMatrix[0][1] = 2 * (x * y - z * w)
rotationMatrix[0][2] = 2 * (x * z + y * w)
rotationMatrix[1][0] = 2 * (x * y + z * w)
rotationMatrix[1][1] = 1 - 2 * (x * x + z * z)
rotationMatrix[1][2] = 2 * (y * z - x * w)
rotationMatrix[2][0] = 2 * (x * z - y * w)
rotationMatrix[2][1] = 2 * (y * z + x * w)
rotationMatrix[2][2] = 1 - 2 * (x * x + y * y)

matrix = multiply(matrix, rotationMatrix)

// apply skew
// temp is a identity 4x4 matrix initially
if (skew[2])
    temp[2][1] = skew[2]
    matrix = multiply(matrix, temp)

if (skew[1])
    temp[2][1] = 0
    temp[2][0] = skew[1]
    matrix = multiply(matrix, temp)

if (skew[0])
    temp[2][0] = 0
    temp[1][0] = skew[0]
    matrix = multiply(matrix, temp)

// apply scale
for (i = 0; i &lt; 3; i++)
  for (j = 0; j &lt; 4; j++)
    matrix[i][j] *= scale[i]

return</pre>
   <h2 class="heading settled" data-level="14" id="interpolation-of-transform-functions"><span class="secno">14. </span><span class="content">Interpolation of primitives and derived transform functions</span><a class="self-link" href="#interpolation-of-transform-functions"></a></h2>
   <p>Two transform functions with the same name and the same number of arguments are interpolated numerically without a former conversion. The calculated value will be of the same transform function type with the same number of arguments. Special rules apply to <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix③">&lt;matrix()></a>, <a class="production css" data-link-type="function" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d③">&lt;matrix3d()></a> and <a class="production css" data-link-type="function" href="#funcdef-perspective" id="ref-for-funcdef-perspective②">&lt;perspective()></a>.</p>
   <p>The transform functions <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix④">&lt;matrix()></a>, <a class="css" data-link-type="maybe" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d④">matrix3d()</a> and <a class="css" data-link-type="maybe" href="#funcdef-perspective" id="ref-for-funcdef-perspective③">perspective()</a> get converted into 4x4 matrices first and interpolated as defined in section <a href="#matrix-interpolation">Interpolation of Matrices</a> afterwards.</p>
   <p>For interpolations with the primitive <a class="css" data-link-type="maybe" href="#funcdef-rotate3d" id="ref-for-funcdef-rotate3d②">rotate3d()</a>, the direction vectors of the transform functions get normalized first. If the normalized vectors are not equal and both rotation angles are non-zero the transform functions get converted into 4x4 matrices first and interpolated as defined in section <a href="#matrix-interpolation">Interpolation of Matrices</a> afterwards. Otherwise the rotation angle gets interpolated numerically and the rotation vector of the non-zero angle is used or (0, 0, 1) if both angles are zero.</p>
   <h2 class="heading settled" data-level="15" id="combining-transform-lists"><span class="secno">15. </span><span class="content">Addition and accumulation of transform lists</span><a class="self-link" href="#combining-transform-lists"></a></h2>
   <div class="algorithm" data-algorithm="transform list addition"> <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#addition" id="ref-for-addition">Addition</a> of two transform lists <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var> is defined as <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> concatenation
  such that <var>V<sub>result</sub></var> is equal to <var>V<sub>b</sub></var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">appended</a> to <var>V<sub>a</sub></var>. </div>
   <div class="algorithm" data-algorithm="transform list accumulation">
     <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#accumulation" id="ref-for-accumulation">Accumulation</a> of two transform lists <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var> follows the same steps as interpolation
  with regards to matching transform functions including
  padding lists with <a data-link-type="dfn" href="#identity-transform-function" id="ref-for-identity-transform-function">identity transform functions</a>,
  converting <span class="css">none</span> to an <span id="ref-for-identity-transform-function①">identity transform function</span>,
  and converting both arguments to matrices as necessary (see <a href="https://www.w3.org/TR/css-transforms-1/#interpolation-of-transforms">CSS Transforms 1 §11 Interpolation of Transforms</a>).
  However, instead of interpolating the individual parameters,
  they are combined using arithmetic addition—<wbr>except in the case of parameters whose value is one in the <span id="ref-for-identity-transform-function②">identity transform function</span> (e.g. scale parameters and matrix elements <var>m11</var>, <var>m22</var>, <var>m33</var>, and <var>m44</var>),
  which combine using <dfn data-dfn-type="dfn" data-export id="accumulation-for-one-based-values">accumulation for one-based values<a class="self-link" href="#accumulation-for-one-based-values"></a></dfn> as follows: 
    <p><var>V<sub>result</sub></var> = <var>V<sub>a</sub></var> + <var>V<sub>b</sub></var> - 1</p>
    <div class="note" role="note">
      The above definition preserves the intent of <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#accumulation" id="ref-for-accumulation①">accumulation</a> which is that <var>V<sub>b</sub></var> acts as
    a delta from <var>V<sub>a</sub></var> and allows an animation such as: 
<pre class="lang-javascript highlight">div<c- p>.</c->animate<c- p>(</c->
  <c- p>{</c-> transform<c- o>:</c-> <c- p>[</c-><c- t>'scale(1)'</c-><c- p>,</c-> <c- t>'scale(2)'</c-><c- p>]</c-> <c- p>},</c->
  <c- p>{</c->
    duration<c- o>:</c-> <c- mi>1000</c-><c- p>,</c->
    easing<c- o>:</c-> <c- t>'ease'</c-><c- p>,</c->
  <c- p>}</c->
<c- p>);</c->
</pre>
     <p>to produce the expected behavior when extended as follows:</p>
<pre class="lang-javascript highlight">div<c- p>.</c->animate<c- p>(</c->
  <c- p>{</c-> transform<c- o>:</c-> <c- p>[</c-><c- t>'scale(1)'</c-><c- p>,</c-> <c- t>'scale(2)'</c-><c- p>]</c-> <c- p>},</c->
  <c- p>{</c->
    duration<c- o>:</c-> <c- mi>1000</c-><c- p>,</c->
    easing<c- o>:</c-> <c- t>'ease'</c-><c- p>,</c->
    <strong>iterations<c- o>:</c-> <c- mi>5</c-><c- p>,</c->
    iterationComposite<c- o>:</c-> <c- t>'accumulate'</c-><c- p>,</c-></strong>
  <c- p>}</c->
<c- p>);</c->
</pre>
    </div>
   </div>
   <h3 class="heading settled" data-level="15.1" id="neutral-element"><span class="secno">15.1. </span><span class="content">Neutral element for addition</span><a class="self-link" href="#neutral-element"></a></h3>
   <p>Some animations require a neutral element for addition. For transform functions this is a scalar or a list of scalars of 0. Examples of neutral elements for transform functions are <span class="css">translate(0)</span>, <span class="css">translate3d(0, 0, 0)</span>, <span class="css">translateX(0)</span>, <span class="css">translateY(0)</span>, <span class="css">translateZ(0)</span>, <span class="css">scale(0)</span>, <span class="css">scaleX(0)</span>, <span class="css">scaleY(0)</span>, <span class="css">scaleZ(0)</span>, <span class="css">rotate(0)</span>, <span class="css">rotate3d(vx, vy, vz, 0)</span> (where <var>v</var> is a context dependent vector), <span class="css">rotateX(0)</span>, <span class="css">rotateY(0)</span>, <span class="css">rotateZ(0)</span>, <span class="css">skew(0, 0)</span>, <span class="css">skewX(0)</span>, <span class="css">skewY(0)</span>, <span class="css">matrix(0, 0, 0, 0, 0, 0)</span>, <span class="css">matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)</span> and <span class="css">perspective(0)</span>.</p>
   <p class="note" role="note"><span>Note:</span> Animations to or from the neutral element of additions <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix⑤">&lt;matrix()></a>, <a class="css" data-link-type="maybe" href="#funcdef-matrix3d" id="ref-for-funcdef-matrix3d⑤">matrix3d()</a> and <a class="css" data-link-type="maybe" href="#funcdef-perspective" id="ref-for-funcdef-perspective④">perspective()</a> fall back to discrete animations (See <a href="#matrix-interpolation">§ 13 Interpolation of Matrices</a>).</p>
   <h2 class="heading settled" data-level="16" id="mathematical-description"><span class="secno">16. </span><span class="content">Mathematical Description of Transform Functions</span><a class="self-link" href="#mathematical-description"></a></h2>
   <p>Mathematically, all transform functions can be represented as 4x4 transformation matrices of the following form:</p>
   <p><img alt="\begin{bmatrix} m11 &amp; m21 &amp; m31 &amp; m41 \\ m12 &amp; m22 &amp; m32 &amp; m42 \\ m13 &amp; m23 &amp; m33 &amp; m43 \\ m14 &amp; m24 &amp; m34 &amp; m44 \end{bmatrix}" height="106" src="images/4x4matrix.png" width="222"></p>
   <p>One translation unit on a matrix is equivalent to 1 pixel in the local coordinate system of the element.</p>
   <ul>
    <li id="Translate3dDefined">
     <a class="self-link" href="#Translate3dDefined"></a> A 3D translation with the parameters <em>tx</em>, <em>ty</em> and <em>tz</em> is equivalent to the matrix: 
     <p><img alt="\begin{bmatrix} 1 &amp; 0 &amp; 0 &amp; tx \\ 0 &amp; 1 &amp; 0 &amp; ty \\ 0 &amp; 0 &amp; 1 &amp; tz \\ 0 &amp; 0 &amp; 0 &amp; 1 \end{bmatrix}" height="106" src="images/translate3d.png" width="114"></p>
    <li id="Scale3dDefined">
     <a class="self-link" href="#Scale3dDefined"></a> A 3D scaling with the parameters <em>sx</em>, <em>sy</em> and <em>sz</em> is equivalent to the matrix: 
     <p><img alt="\begin{bmatrix} sx &amp; 0 &amp; 0 &amp; 0 \\ 0 &amp; sy &amp; 0 &amp; 0 \\ 0 &amp; 0 &amp; sz &amp; 0 \\ 0 &amp; 0 &amp; 0 &amp; 1 \end{bmatrix}" height="106" src="images/scale3d.png" width="137"></p>
    <li id="Rotate3dDefined">
     <a class="self-link" href="#Rotate3dDefined"></a> A 3D rotation with the vector [x,y,z] and the parameter <em>alpha</em> is equivalent to the matrix: 
     <p><img alt="\begin{bmatrix} 1 - 2 \cdot (y^2 + z^2) \cdot sq &amp; 2 \cdot (x \cdot y \cdot sq - z \cdot sc) &amp; 2 \cdot (x \cdot z \cdot sq + y \cdot sc) &amp; 0 \\ 2 \cdot (x \cdot y \cdot sq + z \cdot sc) &amp; 1 - 2 \cdot (x^2 + z^2) \cdot sq &amp; 2 \cdot (y \cdot z \cdot sq - x \cdot sc) &amp; 0 \\ 2 \cdot (x \cdot z \cdot sq - y \cdot sc) &amp; 2 \cdot (y \cdot z \cdot sq + x \cdot sc) &amp; 1 - 2 \cdot (x^2 + y^2) \cdot sq &amp; 0 \\ 0 &amp; 0 &amp; 0 &amp; 1 \end{bmatrix}" height="106" src="images/rotate3dmatrix.png" width="647"></p>
     <p>where:</p>
     <p><img alt="\newline sc = \sin (\alpha/2) \cdot \cos (\alpha/2) \newline sq = \sin^2 (\alpha/2)" height="50" src="images/rotate3dvariables.png" width="221"></p>
    <li id="PerspectiveDefined">
     <a class="self-link" href="#PerspectiveDefined"></a> A perspective projection matrix with the parameter <em>d</em> is equivalent to the matrix: 
     <p><img alt="\begin{bmatrix} 1 &amp; 0 &amp; 0 &amp; 0 \\ 0 &amp; 1 &amp; 0 &amp; 0 \\ 0 &amp; 0 &amp; 1 &amp; 0 \\ 0 &amp; 0 &amp; -1/d &amp; 1 \end{bmatrix}" height="106" src="images/perspective.png" width="143"></p>
   </ul>
   <h2 class="heading settled" data-level="17" id="svg-transform"><span class="secno">17. </span><span class="content">The SVG <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform①⑤">transform</a> Attribute</span><a class="self-link" href="#svg-transform"></a></h2>
   <p>This specification will also introduce the new presentation attributes <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin" id="ref-for-propdef-transform-origin⑦">transform-origin</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①⑥">perspective</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①④">perspective-origin</a>, <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style①⓪">transform-style</a> and <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility⑧">backface-visibility</a>.</p>
   <p>Values on new introduced presentation attributes get parsed following the syntax rules on <a data-link-type="dfn">SVG Data Types</a> <a data-link-type="biblio" href="#biblio-svg11">[SVG11]</a>.</p>
   <h2 class="heading settled" data-level="18" id="svg-animation"><span class="secno">18. </span><span class="content">SVG Animation</span><a class="self-link" href="#svg-animation"></a></h2>
   <h3 class="heading settled" data-level="18.1" id="svg-animate-element"><span class="secno">18.1. </span><span class="content">The <code><a data-link-type="element" href="https://www.w3.org/TR/SVG11/animate.html#AnimateElement" id="ref-for-AnimateElement">animate</a></code> and <code><a data-link-type="element" href="https://www.w3.org/TR/SVG11/animate.html#SetElement" id="ref-for-SetElement">set</a></code> element</span><a class="self-link" href="#svg-animate-element"></a></h3>
   <p>The introduce presentation attributes <a class="property" data-link-type="propdesc" href="#propdef-perspective" id="ref-for-propdef-perspective①⑦">perspective</a>, <a class="property" data-link-type="propdesc" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①⑤">perspective-origin</a>, <a class="property" data-link-type="propdesc" href="#propdef-transform-style" id="ref-for-propdef-transform-style①①">transform-style</a> and <a class="property" data-link-type="propdesc" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility⑨">backface-visibility</a> are animatable. <span class="property" id="ref-for-propdef-transform-style①②">transform-style</span> and <span class="property" id="ref-for-propdef-backface-visibility①⓪">backface-visibility</span> are non-additive.</p>
   <h2 class="heading settled" data-level="19" id="more-issues"><span class="secno">19. </span><span class="content">More Issues</span><a class="self-link" href="#more-issues"></a></h2>
   <p class="issue" id="issue-b3f9db98"><a class="self-link" href="#issue-b3f9db98"></a> Per <a href="https://lists.w3.org/Archives/Public/www-style/2015Mar/0371.html">https://lists.w3.org/Archives/Public/www-style/2015Mar/0371.html</a>,
the WG resolved to add a formula for decomposing a transform into a unified "scale"
(the spec already defines how to decompose it into scaleX/Y/Z),
for use by things like SVG’s non-scaling stroke spec. <a href="https://www.w3.org/Graphics/SVG/WG/wiki/Proposals/Specifying_decomposition_of_scale">Formula is defined here.</a></p>
   <h2 class="heading settled" data-level="20" id="priv-sec"><span class="secno">20. </span><span class="content">Security and Privacy Considerations</span><a class="self-link" href="#priv-sec"></a></h2>
   <p>This specification introduces no new security or privacy considerations.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#3d-matrix">3D matrix</a><span>, in §2</span>
   <li><a href="#3d-rendering-context">3D rendering context</a><span>, in §2</span>
   <li><a href="#3d-transformed-element">3D transformed element</a><span>, in §2</span>
   <li><a href="#3d-transform-functions">3d transform functions</a><span>, in §12.1</span>
   <li><a href="#accumulated-3d-transformation-matrix">accumulated 3D transformation matrix</a><span>, in §2</span>
   <li><a href="#accumulation-for-one-based-values">accumulation for one-based values</a><span>, in §15</span>
   <li><a href="#propdef-backface-visibility">backface-visibility</a><span>, in §10</span>
   <li><a href="#valdef-perspective-origin-bottom">bottom</a><span>, in §9</span>
   <li><a href="#valdef-perspective-origin-center">center</a><span>, in §9</span>
   <li><a href="#identity-transform-function">identity transform function</a><span>, in §2</span>
   <li><a href="#valdef-perspective-origin-left">left</a><span>, in §9</span>
   <li><a href="#valdef-perspective-origin-length">&lt;length></a><span>, in §9</span>
   <li><a href="#valdef-perspective-length-0">&lt;length [0,∞]></a><span>, in §8</span>
   <li><a href="#funcdef-matrix3d">matrix3d()</a><span>, in §12.1</span>
   <li>
    none
    <ul>
     <li><a href="#valdef-perspective-none">value for perspective</a><span>, in §8</span>
     <li><a href="#valdef-translate-none">value for translate, rotate, scale</a><span>, in §5</span>
    </ul>
   <li><a href="#valdef-perspective-origin-percentage">&lt;percentage></a><span>, in §9</span>
   <li><a href="#propdef-perspective">perspective</a><span>, in §8</span>
   <li><a href="#funcdef-perspective">perspective()</a><span>, in §12.1</span>
   <li><a href="#perspective-matrix">perspective matrix</a><span>, in §2</span>
   <li><a href="#propdef-perspective-origin">perspective-origin</a><span>, in §9</span>
   <li><a href="#valdef-perspective-origin-right">right</a><span>, in §9</span>
   <li><a href="#propdef-rotate">rotate</a><span>, in §5</span>
   <li><a href="#funcdef-rotate3d">rotate3d()</a><span>, in §12.1</span>
   <li><a href="#funcdef-rotatex">rotateX()</a><span>, in §12.1</span>
   <li><a href="#funcdef-rotatey">rotateY()</a><span>, in §12.1</span>
   <li><a href="#funcdef-rotatez">rotateZ()</a><span>, in §12.1</span>
   <li><a href="#propdef-scale">scale</a><span>, in §5</span>
   <li><a href="#funcdef-scale3d">scale3d()</a><span>, in §12.1</span>
   <li><a href="#funcdef-scalez">scaleZ()</a><span>, in §12.1</span>
   <li><a href="#valdef-perspective-origin-top">top</a><span>, in §9</span>
   <li><a href="#typedef-transform-function">&lt;transform-function></a><span>, in §12</span>
   <li><a href="#propdef-transform-style">transform-style</a><span>, in §7</span>
   <li><a href="#propdef-translate">translate</a><span>, in §5</span>
   <li><a href="#funcdef-translate3d">translate3d()</a><span>, in §12.1</span>
   <li><a href="#funcdef-translatez">translateZ()</a><span>, in §12.1</span>
   <li><a href="#valdef-rotate-x">x</a><span>, in §5</span>
   <li><a href="#valdef-rotate-y">y</a><span>, in §5</span>
   <li><a href="#valdef-rotate-z">z</a><span>, in §5</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-propdef-isolation">
   <a href="https://drafts.fxtf.org/compositing-2/#propdef-isolation">https://drafts.fxtf.org/compositing-2/#propdef-isolation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-isolation">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-mix-blend-mode">
   <a href="https://drafts.fxtf.org/compositing-2/#propdef-mix-blend-mode">https://drafts.fxtf.org/compositing-2/#propdef-mix-blend-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-mix-blend-mode">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-background-position">
   <a href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position">https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-background-position">9. The perspective-origin Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-computed-value">
   <a href="https://drafts.csswg.org/css-cascade-4/#computed-value">https://drafts.csswg.org/css-cascade-4/#computed-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-computed-value">2.1. Serialization of the computed value of &lt;transform-list></a> <a href="#ref-for-computed-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-opacity">
   <a href="https://drafts.csswg.org/css-color-4/#propdef-opacity">https://drafts.csswg.org/css-color-4/#propdef-opacity</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-opacity">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-clip">
   <a href="https://drafts.fxtf.org/css-masking-1/#propdef-clip">https://drafts.fxtf.org/css-masking-1/#propdef-clip</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-clip">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-clip-path">
   <a href="https://drafts.fxtf.org/css-masking-1/#propdef-clip-path">https://drafts.fxtf.org/css-masking-1/#propdef-clip-path</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-clip-path">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-clippath">
   <a href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath">https://drafts.fxtf.org/css-masking-1/#elementdef-clippath</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-clippath">11. SVG and 3D transform functions</a> <a href="#ref-for-elementdef-clippath①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-mask">
   <a href="https://drafts.fxtf.org/css-masking-1/#elementdef-mask">https://drafts.fxtf.org/css-masking-1/#elementdef-mask</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-mask">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-mask-border-source">
   <a href="https://drafts.fxtf.org/css-masking-1/#propdef-mask-border-source">https://drafts.fxtf.org/css-masking-1/#propdef-mask-border-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-mask-border-source">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-mask-image">
   <a href="https://drafts.fxtf.org/css-masking-1/#propdef-mask-image">https://drafts.fxtf.org/css-masking-1/#propdef-mask-image</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-mask-image">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-overflow-clip">
   <a href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip">https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-overflow-clip">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-overflow">
   <a href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">https://drafts.csswg.org/css-overflow-3/#propdef-overflow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-overflow">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-overflow-visible">
   <a href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible">https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-overflow-visible">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-2d-matrix">
   <a href="https://drafts.csswg.org/css-transforms-1/#2d-matrix">https://drafts.csswg.org/css-transforms-1/#2d-matrix</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-2d-matrix">2. Terminology</a>
    <li><a href="#ref-for-2d-matrix①">2.1. Serialization of the computed value of &lt;transform-list></a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-transform-list">
   <a href="https://drafts.csswg.org/css-transforms-1/#typedef-transform-list">https://drafts.csswg.org/css-transforms-1/#typedef-transform-list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-transform-list">2.1. Serialization of the computed value of &lt;transform-list></a> <a href="#ref-for-typedef-transform-list①">(2)</a> <a href="#ref-for-typedef-transform-list②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-containing-block-for-all-descendants">
   <a href="https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants">https://drafts.csswg.org/css-transforms-1/#containing-block-for-all-descendants</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-containing-block-for-all-descendants">1.1. Module Interactions</a>
    <li><a href="#ref-for-containing-block-for-all-descendants①">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-containing-block-for-all-descendants②">(2)</a>
    <li><a href="#ref-for-containing-block-for-all-descendants③">7. The transform-style Property</a>
    <li><a href="#ref-for-containing-block-for-all-descendants④">8. The perspective Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-matrix">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-matrix</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-matrix">2.1. Serialization of the computed value of &lt;transform-list></a> <a href="#ref-for-funcdef-transform-matrix①">(2)</a> <a href="#ref-for-funcdef-transform-matrix②">(3)</a>
    <li><a href="#ref-for-funcdef-transform-matrix③">14. Interpolation of primitives and derived transform functions</a> <a href="#ref-for-funcdef-transform-matrix④">(2)</a>
    <li><a href="#ref-for-funcdef-transform-matrix⑤">15.1. Neutral element for addition</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-reference-box">
   <a href="https://drafts.csswg.org/css-transforms-1/#reference-box">https://drafts.csswg.org/css-transforms-1/#reference-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reference-box">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-reference-box①">9. The perspective-origin Property</a> <a href="#ref-for-reference-box②">(2)</a> <a href="#ref-for-reference-box③">(3)</a> <a href="#ref-for-reference-box④">(4)</a> <a href="#ref-for-reference-box⑤">(5)</a> <a href="#ref-for-reference-box⑥">(6)</a>
    <li><a href="#ref-for-reference-box⑦">12. The Transform Functions</a> <a href="#ref-for-reference-box⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-rotate">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-rotate">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-rotate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-rotate">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-funcdef-transform-rotate①">(2)</a>
    <li><a href="#ref-for-funcdef-transform-rotate②">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-scale">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scale">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scale</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-scale">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-funcdef-transform-scale①">(2)</a>
    <li><a href="#ref-for-funcdef-transform-scale②">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-scalex">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scalex">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scalex</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-scalex">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-scaley">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scaley">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-scaley</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-scaley">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-transform">
   <a href="https://drafts.csswg.org/css-transforms-1/#propdef-transform">https://drafts.csswg.org/css-transforms-1/#propdef-transform</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-transform">1. Introduction</a> <a href="#ref-for-propdef-transform①">(2)</a>
    <li><a href="#ref-for-propdef-transform②">1.1. Module Interactions</a>
    <li><a href="#ref-for-propdef-transform③">2. Terminology</a>
    <li><a href="#ref-for-propdef-transform④">3. Two Dimensional Subset</a>
    <li><a href="#ref-for-propdef-transform⑤">4. The Transform Rendering Model</a> <a href="#ref-for-propdef-transform⑥">(2)</a>
    <li><a href="#ref-for-propdef-transform⑦">4.1.4. Accumulated 3D Transformation Matrix Computation</a>
    <li><a href="#ref-for-propdef-transform⑧">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-propdef-transform⑨">(2)</a> <a href="#ref-for-propdef-transform①⓪">(3)</a>
    <li><a href="#ref-for-propdef-transform①①">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-transform①②">(2)</a>
    <li><a href="#ref-for-propdef-transform①③">8. The perspective Property</a>
    <li><a href="#ref-for-propdef-transform①④">12. The Transform Functions</a>
    <li><a href="#ref-for-propdef-transform①⑤">17. The SVG transform Attribute</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-transform-origin">
   <a href="https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin">https://drafts.csswg.org/css-transforms-1/#propdef-transform-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-transform-origin">4. The Transform Rendering Model</a> <a href="#ref-for-propdef-transform-origin①">(2)</a> <a href="#ref-for-propdef-transform-origin②">(3)</a> <a href="#ref-for-propdef-transform-origin③">(4)</a>
    <li><a href="#ref-for-propdef-transform-origin④">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-transform-origin⑤">(2)</a> <a href="#ref-for-propdef-transform-origin⑥">(3)</a>
    <li><a href="#ref-for-propdef-transform-origin⑦">17. The SVG transform Attribute</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-transformable-element">
   <a href="https://drafts.csswg.org/css-transforms-1/#transformable-element">https://drafts.csswg.org/css-transforms-1/#transformable-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-transformable-element">4.1.2. 3D Rendering Contexts</a>
    <li><a href="#ref-for-transformable-element①">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-transformable-element②">(2)</a> <a href="#ref-for-transformable-element③">(3)</a>
    <li><a href="#ref-for-transformable-element④">7. The transform-style Property</a>
    <li><a href="#ref-for-transformable-element⑤">8. The perspective Property</a>
    <li><a href="#ref-for-transformable-element⑥">9. The perspective-origin Property</a>
    <li><a href="#ref-for-transformable-element⑦">10. The backface-visibility Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-transformation-matrix">
   <a href="https://drafts.csswg.org/css-transforms-1/#transformation-matrix">https://drafts.csswg.org/css-transforms-1/#transformation-matrix</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-transformation-matrix">4. The Transform Rendering Model</a>
    <li><a href="#ref-for-transformation-matrix①">4.1.4. Accumulated 3D Transformation Matrix Computation</a>
    <li><a href="#ref-for-transformation-matrix②">6. Current Transformation Matrix</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-transformed-element">
   <a href="https://drafts.csswg.org/css-transforms-1/#transformed-element">https://drafts.csswg.org/css-transforms-1/#transformed-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-transformed-element">4.1.3. Transformed element hierarchies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-translate">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translate">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-translate">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-funcdef-transform-translate①">(2)</a>
    <li><a href="#ref-for-funcdef-transform-translate②">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-translatex">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatex</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-translatex">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-funcdef-transform-translatey">
   <a href="https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatey">https://drafts.csswg.org/css-transforms-1/#funcdef-transform-translatey</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-transform-translatey">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-angle-value">
   <a href="https://drafts.csswg.org/css-values-3/#angle-value">https://drafts.csswg.org/css-values-3/#angle-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-angle-value">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-angle-value①">(2)</a> <a href="#ref-for-angle-value②">(3)</a>
    <li><a href="#ref-for-angle-value③">5.1. Serialization</a>
    <li><a href="#ref-for-angle-value④">6. Current Transformation Matrix</a>
    <li><a href="#ref-for-angle-value⑤">12. The Transform Functions</a>
    <li><a href="#ref-for-angle-value⑥">12.1. 3D Transform Functions</a> <a href="#ref-for-angle-value⑦">(2)</a> <a href="#ref-for-angle-value⑧">(3)</a> <a href="#ref-for-angle-value⑨">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-length-value">
   <a href="https://drafts.csswg.org/css-values-3/#length-value">https://drafts.csswg.org/css-values-3/#length-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-length-value">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-length-value①">8. The perspective Property</a> <a href="#ref-for-length-value②">(2)</a> <a href="#ref-for-length-value③">(3)</a> <a href="#ref-for-length-value④">(4)</a>
    <li><a href="#ref-for-length-value⑤">9. The perspective-origin Property</a>
    <li><a href="#ref-for-length-value⑥">12.1. 3D Transform Functions</a> <a href="#ref-for-length-value⑦">(2)</a> <a href="#ref-for-length-value⑧">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-number-value">
   <a href="https://drafts.csswg.org/css-values-3/#number-value">https://drafts.csswg.org/css-values-3/#number-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-number-value">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-number-value①">(2)</a> <a href="#ref-for-number-value②">(3)</a> <a href="#ref-for-number-value③">(4)</a>
    <li><a href="#ref-for-number-value④">12. The Transform Functions</a>
    <li><a href="#ref-for-number-value⑤">12.1. 3D Transform Functions</a> <a href="#ref-for-number-value⑥">(2)</a> <a href="#ref-for-number-value⑦">(3)</a> <a href="#ref-for-number-value⑧">(4)</a> <a href="#ref-for-number-value⑨">(5)</a> <a href="#ref-for-number-value①⓪">(6)</a> <a href="#ref-for-number-value①①">(7)</a> <a href="#ref-for-number-value①②">(8)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-percentage-value">
   <a href="https://drafts.csswg.org/css-values-3/#percentage-value">https://drafts.csswg.org/css-values-3/#percentage-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-percentage-value">9. The perspective-origin Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-comma">
   <a href="https://drafts.csswg.org/css-values-4/#mult-comma">https://drafts.csswg.org/css-values-4/#mult-comma</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-comma">12.1. 3D Transform Functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-all">
   <a href="https://drafts.csswg.org/css-values-4/#comb-all">https://drafts.csswg.org/css-values-4/#comb-all</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-all">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-comma">
   <a href="https://drafts.csswg.org/css-values-4/#comb-comma">https://drafts.csswg.org/css-values-4/#comb-comma</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-comma">12.1. 3D Transform Functions</a> <a href="#ref-for-comb-comma①">(2)</a> <a href="#ref-for-comb-comma②">(3)</a> <a href="#ref-for-comb-comma③">(4)</a> <a href="#ref-for-comb-comma④">(5)</a> <a href="#ref-for-comb-comma⑤">(6)</a> <a href="#ref-for-comb-comma⑥">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-length-percentage">
   <a href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage">https://drafts.csswg.org/css-values-4/#typedef-length-percentage</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-length-percentage">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-typedef-length-percentage①">(2)</a> <a href="#ref-for-typedef-length-percentage②">(3)</a>
    <li><a href="#ref-for-typedef-length-percentage③">12.1. 3D Transform Functions</a> <a href="#ref-for-typedef-length-percentage④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-position">
   <a href="https://drafts.csswg.org/css-values-4/#typedef-position">https://drafts.csswg.org/css-values-4/#typedef-position</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-position">9. The perspective-origin Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-zero-value">
   <a href="https://drafts.csswg.org/css-values-4/#zero-value">https://drafts.csswg.org/css-values-4/#zero-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-zero-value">12.1. 3D Transform Functions</a> <a href="#ref-for-zero-value①">(2)</a> <a href="#ref-for-zero-value②">(3)</a> <a href="#ref-for-zero-value③">(4)</a> <a href="#ref-for-zero-value④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-opt">
   <a href="https://drafts.csswg.org/css-values-4/#mult-opt">https://drafts.csswg.org/css-values-4/#mult-opt</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-opt">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-mult-opt①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-accumulation">
   <a href="https://drafts.csswg.org/css-values-4/#accumulation">https://drafts.csswg.org/css-values-4/#accumulation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-accumulation">15. Addition and accumulation of transform lists</a> <a href="#ref-for-accumulation①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-addition">
   <a href="https://drafts.csswg.org/css-values-4/#addition">https://drafts.csswg.org/css-values-4/#addition</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-addition">15. Addition and accumulation of transform lists</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-num-range">
   <a href="https://drafts.csswg.org/css-values-4/#mult-num-range">https://drafts.csswg.org/css-values-4/#mult-num-range</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-num-range">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-num">
   <a href="https://drafts.csswg.org/css-values-4/#mult-num">https://drafts.csswg.org/css-values-4/#mult-num</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-num">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-comb-one①">(2)</a> <a href="#ref-for-comb-one②">(3)</a> <a href="#ref-for-comb-one③">(4)</a> <a href="#ref-for-comb-one④">(5)</a> <a href="#ref-for-comb-one⑤">(6)</a> <a href="#ref-for-comb-one⑥">(7)</a>
    <li><a href="#ref-for-comb-one⑦">7. The transform-style Property</a>
    <li><a href="#ref-for-comb-one⑧">8. The perspective Property</a>
    <li><a href="#ref-for-comb-one⑨">10. The backface-visibility Property</a>
    <li><a href="#ref-for-comb-one①⓪">12.1. 3D Transform Functions</a> <a href="#ref-for-comb-one①①">(2)</a> <a href="#ref-for-comb-one①②">(3)</a> <a href="#ref-for-comb-one①③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-x43">
   <a href="https://drafts.csswg.org/css2/visuren.html#x43">https://drafts.csswg.org/css2/visuren.html#x43</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-x43">1.1. Module Interactions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-resolved-value-special-case-property-like-height">
   <a href="https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property-like-height">https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property-like-height</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-resolved-value-special-case-property-like-height">9. The perspective-origin Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-filter">
   <a href="https://drafts.fxtf.org/filter-effects-1/#propdef-filter">https://drafts.fxtf.org/filter-effects-1/#propdef-filter</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-filter">7.1. Grouping property values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-the-a-element">
   <a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element">https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-the-a-element">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-append">
   <a href="https://infra.spec.whatwg.org/#list-append">https://infra.spec.whatwg.org/#list-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-append">15. Addition and accumulation of transform lists</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">15. Addition and accumulation of transform lists</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-offset">
   <a href="https://drafts.fxtf.org/motion-1/#propdef-offset">https://drafts.fxtf.org/motion-1/#propdef-offset</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-offset">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-offset①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-AnimateElement">
   <a href="https://www.w3.org/TR/SVG11/animate.html#AnimateElement">https://www.w3.org/TR/SVG11/animate.html#AnimateElement</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-AnimateElement">18.1. The animate and set element</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SetElement">
   <a href="https://www.w3.org/TR/SVG11/animate.html#SetElement">https://www.w3.org/TR/SVG11/animate.html#SetElement</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SetElement">18.1. The animate and set element</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-container-element">
   <a href="https://svgwg.org/svg2-draft/struct.html#container-element">https://svgwg.org/svg2-draft/struct.html#container-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-container-element">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-foreignObject">
   <a href="https://svgwg.org/svg2-draft/embedded.html#elementdef-foreignObject">https://svgwg.org/svg2-draft/embedded.html#elementdef-foreignObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-foreignObject">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-g">
   <a href="https://svgwg.org/svg2-draft/struct.html#elementdef-g">https://svgwg.org/svg2-draft/struct.html#elementdef-g</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-g">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-graphics-element">
   <a href="https://svgwg.org/svg2-draft/struct.html#graphics-element">https://svgwg.org/svg2-draft/struct.html#graphics-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-graphics-element">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-graphics-referencing-element">
   <a href="https://svgwg.org/svg2-draft/struct.html#graphics-referencing-element">https://svgwg.org/svg2-draft/struct.html#graphics-referencing-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-graphics-referencing-element">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-linearGradient">
   <a href="https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient">https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-linearGradient">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-pattern">
   <a href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern">https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-pattern">11. SVG and 3D transform functions</a> <a href="#ref-for-elementdef-pattern①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-radialGradient">
   <a href="https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient">https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-radialGradient">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-svg">
   <a href="https://svgwg.org/svg2-draft/struct.html#elementdef-svg">https://svgwg.org/svg2-draft/struct.html#elementdef-svg</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-svg">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-VectorEffectProperty">
   <a href="https://svgwg.org/svg2-draft/coords.html#VectorEffectProperty">https://svgwg.org/svg2-draft/coords.html#VectorEffectProperty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-VectorEffectProperty">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[compositing-2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-isolation" style="color:initial">isolation</span>
     <li><span class="dfn-paneled" id="term-for-propdef-mix-blend-mode" style="color:initial">mix-blend-mode</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-backgrounds-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-background-position" style="color:initial">background-position</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-cascade-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-computed-value" style="color:initial">computed value</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-color-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-opacity" style="color:initial">opacity</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-masking-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-clip" style="color:initial">clip</span>
     <li><span class="dfn-paneled" id="term-for-propdef-clip-path" style="color:initial">clip-path</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-clippath" style="color:initial">clippath</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-mask" style="color:initial">mask</span>
     <li><span class="dfn-paneled" id="term-for-propdef-mask-border-source" style="color:initial">mask-border-source</span>
     <li><span class="dfn-paneled" id="term-for-propdef-mask-image" style="color:initial">mask-image</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valdef-overflow-clip" style="color:initial">clip</span>
     <li><span class="dfn-paneled" id="term-for-propdef-overflow" style="color:initial">overflow</span>
     <li><span class="dfn-paneled" id="term-for-valdef-overflow-visible" style="color:initial">visible</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-transforms-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-2d-matrix" style="color:initial">2d matrix</span>
     <li><span class="dfn-paneled" id="term-for-typedef-transform-list" style="color:initial">&lt;transform-list></span>
     <li><span class="dfn-paneled" id="term-for-containing-block-for-all-descendants" style="color:initial">containing block for all descendants</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-matrix" style="color:initial">matrix()</span>
     <li><span class="dfn-paneled" id="term-for-reference-box" style="color:initial">reference box</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-rotate" style="color:initial">rotate()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-scale" style="color:initial">scale()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-scalex" style="color:initial">scalex()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-scaley" style="color:initial">scaley()</span>
     <li><span class="dfn-paneled" id="term-for-propdef-transform" style="color:initial">transform</span>
     <li><span class="dfn-paneled" id="term-for-propdef-transform-origin" style="color:initial">transform-origin</span>
     <li><span class="dfn-paneled" id="term-for-transformable-element" style="color:initial">transformable element</span>
     <li><span class="dfn-paneled" id="term-for-transformation-matrix" style="color:initial">transformation matrix</span>
     <li><span class="dfn-paneled" id="term-for-transformed-element" style="color:initial">transformed element</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-translate" style="color:initial">translate()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-translatex" style="color:initial">translatex()</span>
     <li><span class="dfn-paneled" id="term-for-funcdef-transform-translatey" style="color:initial">translatey()</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-angle-value" style="color:initial">&lt;angle></span>
     <li><span class="dfn-paneled" id="term-for-length-value" style="color:initial">&lt;length></span>
     <li><span class="dfn-paneled" id="term-for-number-value" style="color:initial">&lt;number></span>
     <li><span class="dfn-paneled" id="term-for-percentage-value" style="color:initial">&lt;percentage></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-mult-comma" style="color:initial">#</span>
     <li><span class="dfn-paneled" id="term-for-comb-all" style="color:initial">&amp;&amp;</span>
     <li><span class="dfn-paneled" id="term-for-comb-comma" style="color:initial">,</span>
     <li><span class="dfn-paneled" id="term-for-typedef-length-percentage" style="color:initial">&lt;length-percentage></span>
     <li><span class="dfn-paneled" id="term-for-typedef-position" style="color:initial">&lt;position></span>
     <li><span class="dfn-paneled" id="term-for-zero-value" style="color:initial">&lt;zero></span>
     <li><span class="dfn-paneled" id="term-for-mult-opt" style="color:initial">?</span>
     <li><span class="dfn-paneled" id="term-for-accumulation" style="color:initial">value accumulation</span>
     <li><span class="dfn-paneled" id="term-for-addition" style="color:initial">value addition</span>
     <li><span class="dfn-paneled" id="term-for-mult-num-range" style="color:initial">{a,b}</span>
     <li><span class="dfn-paneled" id="term-for-mult-num" style="color:initial">{a}</span>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS21]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-x43" style="color:initial">stacking context</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSSOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-resolved-value-special-case-property-like-height" style="color:initial">resolved value special case property like height</span>
    </ul>
   <li>
    <a data-link-type="biblio">[filter-effects-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-filter" style="color:initial">filter</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-the-a-element" style="color:initial">a</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-list-append" style="color:initial">append</span>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
    </ul>
   <li>
    <a data-link-type="biblio">[motion-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-offset" style="color:initial">offset</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SVG11]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-AnimateElement" style="color:initial">animate</span>
     <li><span class="dfn-paneled" id="term-for-SetElement" style="color:initial">set</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SVG2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-container-element" style="color:initial">container element</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-foreignObject" style="color:initial">foreignobject</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-g" style="color:initial">g</span>
     <li><span class="dfn-paneled" id="term-for-graphics-element" style="color:initial">graphics element</span>
     <li><span class="dfn-paneled" id="term-for-graphics-referencing-element" style="color:initial">graphics referencing element</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-linearGradient" style="color:initial">lineargradient</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-pattern" style="color:initial">pattern</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-radialGradient" style="color:initial">radialgradient</span>
     <li><span class="dfn-paneled" id="term-for-elementdef-svg" style="color:initial">svg</span>
     <li><span class="dfn-paneled" id="term-for-VectorEffectProperty" style="color:initial">vector-effect</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-compositing-2">[COMPOSITING-2]
   <dd>Compositing and Blending Level 2 URL: <a href="https://drafts.fxtf.org/compositing-2/">https://drafts.fxtf.org/compositing-2/</a>
   <dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3]
   <dd>Bert Bos; Elika Etemad; Brad Kemper. <a href="https://www.w3.org/TR/css-backgrounds-3/">CSS Backgrounds and Borders Module Level 3</a>. 17 October 2017. CR. URL: <a href="https://www.w3.org/TR/css-backgrounds-3/">https://www.w3.org/TR/css-backgrounds-3/</a>
   <dt id="biblio-css-cascade-4">[CSS-CASCADE-4]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-cascade-4/">CSS Cascading and Inheritance Level 4</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-cascade-4/">https://www.w3.org/TR/css-cascade-4/</a>
   <dt id="biblio-css-color-4">[CSS-COLOR-4]
   <dd>Tab Atkins Jr.; Chris Lilley. <a href="https://www.w3.org/TR/css-color-4/">CSS Color Module Level 4</a>. 5 March 2019. WD. URL: <a href="https://www.w3.org/TR/css-color-4/">https://www.w3.org/TR/css-color-4/</a>
   <dt id="biblio-css-masking-1">[CSS-MASKING-1]
   <dd>Dirk Schulze; Brian Birtles; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-masking-1/">CSS Masking Module Level 1</a>. 26 August 2014. CR. URL: <a href="https://www.w3.org/TR/css-masking-1/">https://www.w3.org/TR/css-masking-1/</a>
   <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3]
   <dd>David Baron; Elika Etemad; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-3/">CSS Overflow Module Level 3</a>. 31 July 2018. WD. URL: <a href="https://www.w3.org/TR/css-overflow-3/">https://www.w3.org/TR/css-overflow-3/</a>
   <dt id="biblio-css-transforms-1">[CSS-TRANSFORMS-1]
   <dd>Simon Fraser; et al. <a href="https://www.w3.org/TR/css-transforms-1/">CSS Transforms Module Level 1</a>. 14 February 2019. CR. URL: <a href="https://www.w3.org/TR/css-transforms-1/">https://www.w3.org/TR/css-transforms-1/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css21">[CSS21]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a>
   <dt id="biblio-cssom">[CSSOM]
   <dd>Simon Pieters; Glenn Adams. <a href="https://www.w3.org/TR/cssom-1/">CSS Object Model (CSSOM)</a>. 17 March 2016. WD. URL: <a href="https://www.w3.org/TR/cssom-1/">https://www.w3.org/TR/cssom-1/</a>
   <dt id="biblio-filter-effects-1">[FILTER-EFFECTS-1]
   <dd>Dirk Schulze; Dean Jackson. <a href="https://www.w3.org/TR/filter-effects-1/">Filter Effects Module Level 1</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/filter-effects-1/">https://www.w3.org/TR/filter-effects-1/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-motion-1">[MOTION-1]
   <dd>Dirk Schulze; et al. <a href="https://www.w3.org/TR/motion-1/">Motion Path Module Level 1</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/motion-1/">https://www.w3.org/TR/motion-1/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-svg11">[SVG11]
   <dd>Erik Dahlström; et al. <a href="https://www.w3.org/TR/SVG11/">Scalable Vector Graphics (SVG) 1.1 (Second Edition)</a>. 16 August 2011. REC. URL: <a href="https://www.w3.org/TR/SVG11/">https://www.w3.org/TR/SVG11/</a>
   <dt id="biblio-svg2">[SVG2]
   <dd>Amelia Bellamy-Royds; et al. <a href="https://www.w3.org/TR/SVG2/">Scalable Vector Graphics (SVG) 2</a>. 4 October 2018. CR. URL: <a href="https://www.w3.org/TR/SVG2/">https://www.w3.org/TR/SVG2/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
      <th scope="col">Used value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-backface-visibility" id="ref-for-propdef-backface-visibility①①">backface-visibility</a>
      <td>visible | hidden
      <td>visible
      <td>transformable elements
      <td>no
      <td>N/A
      <td>discrete
      <td>per grammar
      <td>specified keyword
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-perspective" id="ref-for-propdef-perspective①⑧">perspective</a>
      <td>none | &lt;length [0,∞]>
      <td>none
      <td>transformable elements
      <td>no
      <td>N/A
      <td>by computed value
      <td>per grammar
      <td>the keyword none or an absolute length
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-perspective-origin" id="ref-for-propdef-perspective-origin①⑥">perspective-origin</a>
      <td>&lt;position>
      <td>50% 50%
      <td>transformable elements
      <td>no
      <td>refer to the size of the reference box
      <td>by computed value
      <td>per grammar
      <td>see background-position
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-rotate" id="ref-for-propdef-rotate①⓪">rotate</a>
      <td>none | &lt;angle> | [ x | y | z | &lt;number>{3} ] &amp;&amp; &lt;angle>
      <td>none
      <td>transformable elements
      <td>no
      <td>n/a
      <td>as SLERP, but see below for none
      <td>per grammar
      <td>the keyword none, or an &lt;angle> with an optional axis consisting of a list of three &lt;number>s
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scale" id="ref-for-propdef-scale⑧">scale</a>
      <td>none | &lt;number>{1,3}
      <td>none
      <td>transformable elements
      <td>no
      <td>n/a
      <td>by computed value, but see below for none
      <td>per grammar
      <td>the keyword none, or a list of 2 or 3 &lt;number>s
      <td>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-transform-style" id="ref-for-propdef-transform-style①③">transform-style</a>
      <td>flat | preserve-3d
      <td>flat
      <td>transformable elements
      <td>no
      <td>N/A
      <td>discrete
      <td>per grammar
      <td>specified keyword
      <td>flat if a grouping property is present, specified keyword otherwise
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-translate" id="ref-for-propdef-translate⑨">translate</a>
      <td>none | &lt;length-percentage> [ &lt;length-percentage> &lt;length>? ]?
      <td>none
      <td>transformable elements
      <td>no
      <td>relative to the width of the reference box (for the first value) or the height (for the second value)
      <td>by computed value, adding a third 0 value if needed to match components, but see below for none
      <td>per grammar
      <td>the keyword none or a pair of computed &lt;length-percentage> values and optionally an absolute length
      <td>
   </table>
  </div>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> fix this text to add to the text in CSS Transforms 1.<a href="#issue-8241ab72"> ↵ </a></div>
   <div class="issue"> describe how nested 3d-transformed elements render (perhaps with math)<a href="#issue-aae09890"> ↵ </a></div>
   <div class="issue"> This example doesn’t follow from the previous text.<a href="#issue-699eabea"> ↵ </a></div>
   <div class="issue"> This doesn’t describe how untransformed content within a 3D transformed element is handled, the alogrithm probably needs to be recursive.
Issue: Figure out what the current behaviour of various engines is, and figure out a clearer description that wont break web compat.<a href="#issue-366ccca6"> ↵ </a></div>
   <div class="issue"> is it OK to not pop 2D-transformed elements into their own planes?<a href="#issue-d667e5bf"> ↵ </a></div>
   <div class="issue"> requiring intersection with non-transformed content and descendants requires UAs to allocate additional textures (possibly doubling memory use). Would be more efficient to simply render content and untransformed descendants along with background and borders.<a href="#issue-d1f8f85e"> ↵ </a></div>
   <div class="issue"> what is the impact of backface-visibility on non-transformed or 2D-transformed elements? Do they get popped into their own planes and intersect?<a href="#issue-7b36039d"> ↵ </a></div>
   <div class="issue"> This is a first pass at an attempt to precisely specify how exactly to transform elements using the provided matrices. It might not be ideal, and implementer feedback is encouraged.  See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15605">bug 15605</a>.<a href="#issue-0f626662"> ↵ </a></div>
   <div class="issue"> Verify that projection is the distance to the center of projection.<a href="#issue-8678c096"> ↵ </a></div>
   <div class="issue"> We don’t really need to be a stacking context or containing block for perspective, but maybe webcompat means we can’t change this.<a href="#issue-d6818476"> ↵ </a></div>
   <div class="issue"> Backface-visibility cannot be tested by only looking at m33. See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=23014">Bug 23014</a>.<a href="#issue-972d97c8"> ↵ </a></div>
   <div class="issue"> Per <a href="https://lists.w3.org/Archives/Public/www-style/2015Mar/0371.html">https://lists.w3.org/Archives/Public/www-style/2015Mar/0371.html</a>,
the WG resolved to add a formula for decomposing a transform into a unified "scale"
(the spec already defines how to decompose it into scaleX/Y/Z),
for use by things like SVG’s non-scaling stroke spec. <a href="https://www.w3.org/Graphics/SVG/WG/wiki/Proposals/Specifying_decomposition_of_scale">Formula is defined here.</a><a href="#issue-b3f9db98"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="3d-transformed-element">
   <b><a href="#3d-transformed-element">#3d-transformed-element</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-3d-transformed-element">4.1.2. 3D Rendering Contexts</a> <a href="#ref-for-3d-transformed-element①">(2)</a> <a href="#ref-for-3d-transformed-element②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="3d-matrix">
   <b><a href="#3d-matrix">#3d-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-3d-matrix">13. Interpolation of Matrices</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="identity-transform-function">
   <b><a href="#identity-transform-function">#identity-transform-function</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-identity-transform-function">15. Addition and accumulation of transform lists</a> <a href="#ref-for-identity-transform-function①">(2)</a> <a href="#ref-for-identity-transform-function②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="perspective-matrix">
   <b><a href="#perspective-matrix">#perspective-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-perspective-matrix">4.1.1. Perspective</a>
    <li><a href="#ref-for-perspective-matrix①">4.1.4. Accumulated 3D Transformation Matrix Computation</a>
    <li><a href="#ref-for-perspective-matrix②">8. The perspective Property</a>
    <li><a href="#ref-for-perspective-matrix③">9. The perspective-origin Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="accumulated-3d-transformation-matrix">
   <b><a href="#accumulated-3d-transformation-matrix">#accumulated-3d-transformation-matrix</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-accumulated-3d-transformation-matrix">4.1.4. Accumulated 3D Transformation Matrix Computation</a> <a href="#ref-for-accumulated-3d-transformation-matrix①">(2)</a>
    <li><a href="#ref-for-accumulated-3d-transformation-matrix②">4.1.5. Backface Visibility</a>
    <li><a href="#ref-for-accumulated-3d-transformation-matrix③">4.2. Processing of Perspective-Transformed Boxes</a> <a href="#ref-for-accumulated-3d-transformation-matrix④">(2)</a>
    <li><a href="#ref-for-accumulated-3d-transformation-matrix⑤">10. The backface-visibility Property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="3d-rendering-context">
   <b><a href="#3d-rendering-context">#3d-rendering-context</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-3d-rendering-context">2. Terminology</a>
    <li><a href="#ref-for-3d-rendering-context①">4.1. 3D Transform Rendering</a>
    <li><a href="#ref-for-3d-rendering-context②">4.1.2. 3D Rendering Contexts</a> <a href="#ref-for-3d-rendering-context③">(2)</a> <a href="#ref-for-3d-rendering-context④">(3)</a> <a href="#ref-for-3d-rendering-context⑤">(4)</a> <a href="#ref-for-3d-rendering-context⑥">(5)</a> <a href="#ref-for-3d-rendering-context⑦">(6)</a> <a href="#ref-for-3d-rendering-context⑧">(7)</a>
    <li><a href="#ref-for-3d-rendering-context⑨">4.1.3. Transformed element hierarchies</a>
    <li><a href="#ref-for-3d-rendering-context①⓪">4.1.4. Accumulated 3D Transformation Matrix Computation</a> <a href="#ref-for-3d-rendering-context①①">(2)</a> <a href="#ref-for-3d-rendering-context①②">(3)</a>
    <li><a href="#ref-for-3d-rendering-context①③">4.1.5. Backface Visibility</a>
    <li><a href="#ref-for-3d-rendering-context①④">7. The transform-style Property</a>
    <li><a href="#ref-for-3d-rendering-context①⑤">11. SVG and 3D transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-translate">
   <b><a href="#propdef-translate">#propdef-translate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-translate">1. Introduction</a>
    <li><a href="#ref-for-propdef-translate①">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-propdef-translate②">(2)</a> <a href="#ref-for-propdef-translate③">(3)</a> <a href="#ref-for-propdef-translate④">(4)</a> <a href="#ref-for-propdef-translate⑤">(5)</a>
    <li><a href="#ref-for-propdef-translate⑥">5.1. Serialization</a>
    <li><a href="#ref-for-propdef-translate⑦">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-translate⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-rotate">
   <b><a href="#propdef-rotate">#propdef-rotate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-rotate">1. Introduction</a>
    <li><a href="#ref-for-propdef-rotate①">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-propdef-rotate②">(2)</a> <a href="#ref-for-propdef-rotate③">(3)</a> <a href="#ref-for-propdef-rotate④">(4)</a> <a href="#ref-for-propdef-rotate⑤">(5)</a> <a href="#ref-for-propdef-rotate⑥">(6)</a>
    <li><a href="#ref-for-propdef-rotate⑦">5.1. Serialization</a>
    <li><a href="#ref-for-propdef-rotate⑧">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-rotate⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scale">
   <b><a href="#propdef-scale">#propdef-scale</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scale">1. Introduction</a>
    <li><a href="#ref-for-propdef-scale①">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-propdef-scale②">(2)</a> <a href="#ref-for-propdef-scale③">(3)</a> <a href="#ref-for-propdef-scale④">(4)</a>
    <li><a href="#ref-for-propdef-scale⑤">5.1. Serialization</a>
    <li><a href="#ref-for-propdef-scale⑥">6. Current Transformation Matrix</a> <a href="#ref-for-propdef-scale⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-translate-none">
   <b><a href="#valdef-translate-none">#valdef-translate-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-translate-none">5. Individual Transform Properties: the translate, scale, and rotate properties</a> <a href="#ref-for-valdef-translate-none①">(2)</a> <a href="#ref-for-valdef-translate-none②">(3)</a> <a href="#ref-for-valdef-translate-none③">(4)</a> <a href="#ref-for-valdef-translate-none④">(5)</a> <a href="#ref-for-valdef-translate-none⑤">(6)</a> <a href="#ref-for-valdef-translate-none⑥">(7)</a> <a href="#ref-for-valdef-translate-none⑦">(8)</a>
    <li><a href="#ref-for-valdef-translate-none⑧">5.1. Serialization</a> <a href="#ref-for-valdef-translate-none⑨">(2)</a> <a href="#ref-for-valdef-translate-none①⓪">(3)</a> <a href="#ref-for-valdef-translate-none①①">(4)</a> <a href="#ref-for-valdef-translate-none①②">(5)</a> <a href="#ref-for-valdef-translate-none①③">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-transform-style">
   <b><a href="#propdef-transform-style">#propdef-transform-style</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-transform-style">1. Introduction</a>
    <li><a href="#ref-for-propdef-transform-style①">1.1. Module Interactions</a>
    <li><a href="#ref-for-propdef-transform-style②">3. Two Dimensional Subset</a>
    <li><a href="#ref-for-propdef-transform-style③">4.1.2. 3D Rendering Contexts</a> <a href="#ref-for-propdef-transform-style④">(2)</a>
    <li><a href="#ref-for-propdef-transform-style⑤">4.1.3. Transformed element hierarchies</a>
    <li><a href="#ref-for-propdef-transform-style⑥">7. The transform-style Property</a> <a href="#ref-for-propdef-transform-style⑦">(2)</a>
    <li><a href="#ref-for-propdef-transform-style⑧">11. SVG and 3D transform functions</a> <a href="#ref-for-propdef-transform-style⑨">(2)</a>
    <li><a href="#ref-for-propdef-transform-style①⓪">17. The SVG transform Attribute</a>
    <li><a href="#ref-for-propdef-transform-style①①">18.1. The animate and set element</a> <a href="#ref-for-propdef-transform-style①②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-perspective">
   <b><a href="#propdef-perspective">#propdef-perspective</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-perspective">1. Introduction</a>
    <li><a href="#ref-for-propdef-perspective①">1.1. Module Interactions</a>
    <li><a href="#ref-for-propdef-perspective②">2. Terminology</a>
    <li><a href="#ref-for-propdef-perspective③">3. Two Dimensional Subset</a>
    <li><a href="#ref-for-propdef-perspective④">4. The Transform Rendering Model</a>
    <li><a href="#ref-for-propdef-perspective⑤">4.1.1. Perspective</a> <a href="#ref-for-propdef-perspective⑥">(2)</a> <a href="#ref-for-propdef-perspective⑦">(3)</a> <a href="#ref-for-propdef-perspective⑧">(4)</a>
    <li><a href="#ref-for-propdef-perspective⑨">4.1.4. Accumulated 3D Transformation Matrix Computation</a>
    <li><a href="#ref-for-propdef-perspective①⓪">8. The perspective Property</a> <a href="#ref-for-propdef-perspective①①">(2)</a> <a href="#ref-for-propdef-perspective①②">(3)</a>
    <li><a href="#ref-for-propdef-perspective①③">9. The perspective-origin Property</a> <a href="#ref-for-propdef-perspective①④">(2)</a>
    <li><a href="#ref-for-propdef-perspective①⑤">11. SVG and 3D transform functions</a>
    <li><a href="#ref-for-propdef-perspective①⑥">17. The SVG transform Attribute</a>
    <li><a href="#ref-for-propdef-perspective①⑦">18.1. The animate and set element</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-perspective-none">
   <b><a href="#valdef-perspective-none">#valdef-perspective-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-perspective-none">4.1.4. Accumulated 3D Transformation Matrix Computation</a>
    <li><a href="#ref-for-valdef-perspective-none①">8. The perspective Property</a> <a href="#ref-for-valdef-perspective-none②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-perspective-origin">
   <b><a href="#propdef-perspective-origin">#propdef-perspective-origin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-perspective-origin">1. Introduction</a>
    <li><a href="#ref-for-propdef-perspective-origin①">2. Terminology</a>
    <li><a href="#ref-for-propdef-perspective-origin②">3. Two Dimensional Subset</a>
    <li><a href="#ref-for-propdef-perspective-origin③">4.1.1. Perspective</a> <a href="#ref-for-propdef-perspective-origin④">(2)</a> <a href="#ref-for-propdef-perspective-origin⑤">(3)</a> <a href="#ref-for-propdef-perspective-origin⑥">(4)</a>
    <li><a href="#ref-for-propdef-perspective-origin⑦">8. The perspective Property</a>
    <li><a href="#ref-for-propdef-perspective-origin⑧">9. The perspective-origin Property</a> <a href="#ref-for-propdef-perspective-origin⑨">(2)</a> <a href="#ref-for-propdef-perspective-origin①⓪">(3)</a> <a href="#ref-for-propdef-perspective-origin①①">(4)</a> <a href="#ref-for-propdef-perspective-origin①②">(5)</a>
    <li><a href="#ref-for-propdef-perspective-origin①③">11. SVG and 3D transform functions</a>
    <li><a href="#ref-for-propdef-perspective-origin①④">17. The SVG transform Attribute</a>
    <li><a href="#ref-for-propdef-perspective-origin①⑤">18.1. The animate and set element</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-backface-visibility">
   <b><a href="#propdef-backface-visibility">#propdef-backface-visibility</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-backface-visibility">1. Introduction</a>
    <li><a href="#ref-for-propdef-backface-visibility①">1.1. Module Interactions</a>
    <li><a href="#ref-for-propdef-backface-visibility②">3. Two Dimensional Subset</a>
    <li><a href="#ref-for-propdef-backface-visibility③">4.1.5. Backface Visibility</a> <a href="#ref-for-propdef-backface-visibility④">(2)</a>
    <li><a href="#ref-for-propdef-backface-visibility⑤">10. The backface-visibility Property</a> <a href="#ref-for-propdef-backface-visibility⑥">(2)</a>
    <li><a href="#ref-for-propdef-backface-visibility⑦">11. SVG and 3D transform functions</a>
    <li><a href="#ref-for-propdef-backface-visibility⑧">17. The SVG transform Attribute</a>
    <li><a href="#ref-for-propdef-backface-visibility⑨">18.1. The animate and set element</a> <a href="#ref-for-propdef-backface-visibility①⓪">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-transform-function">
   <b><a href="#typedef-transform-function">#typedef-transform-function</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-transform-function">2.1. Serialization of the computed value of &lt;transform-list></a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="3d-transform-functions">
   <b><a href="#3d-transform-functions">#3d-transform-functions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-3d-transform-functions">1.1. Module Interactions</a>
    <li><a href="#ref-for-3d-transform-functions①">2. Terminology</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-matrix3d">
   <b><a href="#funcdef-matrix3d">#funcdef-matrix3d</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-matrix3d">2.1. Serialization of the computed value of &lt;transform-list></a> <a href="#ref-for-funcdef-matrix3d①">(2)</a> <a href="#ref-for-funcdef-matrix3d②">(3)</a>
    <li><a href="#ref-for-funcdef-matrix3d③">14. Interpolation of primitives and derived transform functions</a> <a href="#ref-for-funcdef-matrix3d④">(2)</a>
    <li><a href="#ref-for-funcdef-matrix3d⑤">15.1. Neutral element for addition</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-translate3d">
   <b><a href="#funcdef-translate3d">#funcdef-translate3d</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-translate3d">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-funcdef-translate3d①">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-translatez">
   <b><a href="#funcdef-translatez">#funcdef-translatez</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-translatez">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-scale3d">
   <b><a href="#funcdef-scale3d">#funcdef-scale3d</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-scale3d">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-funcdef-scale3d①">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-scalez">
   <b><a href="#funcdef-scalez">#funcdef-scalez</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-scalez">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-rotate3d">
   <b><a href="#funcdef-rotate3d">#funcdef-rotate3d</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-rotate3d">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-funcdef-rotate3d①">12.2. Transform function primitives and derivatives</a>
    <li><a href="#ref-for-funcdef-rotate3d②">14. Interpolation of primitives and derived transform functions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-rotatex">
   <b><a href="#funcdef-rotatex">#funcdef-rotatex</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-rotatex">5. Individual Transform Properties: the translate, scale, and rotate properties</a>
    <li><a href="#ref-for-funcdef-rotatex①">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-rotatey">
   <b><a href="#funcdef-rotatey">#funcdef-rotatey</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-rotatey">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-rotatez">
   <b><a href="#funcdef-rotatez">#funcdef-rotatez</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-rotatez">12.2. Transform function primitives and derivatives</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-perspective">
   <b><a href="#funcdef-perspective">#funcdef-perspective</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-perspective">4.1.1. Perspective</a> <a href="#ref-for-funcdef-perspective①">(2)</a>
    <li><a href="#ref-for-funcdef-perspective②">14. Interpolation of primitives and derived transform functions</a> <a href="#ref-for-funcdef-perspective③">(2)</a>
    <li><a href="#ref-for-funcdef-perspective④">15.1. Neutral element for addition</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>